org.apache.commons.io.output

Class NullWriter


public class NullWriter
extends Writer

This Writer writes all data to the famous /dev/null.

This Writer has no destination (file/socket etc.) and all characters written to it are ignored and lost.

Version:
$Id: NullWriter.java 610010 2008-01-08 14:50:59Z niallp $

Field Summary

static NullWriter
NULL_WRITER
A singleton.

Constructor Summary

NullWriter()
Constructs a new NullWriter.

Method Summary

void
close()
void
flush()
void
write(String str)
Does nothing - output to /dev/null.
void
write(String str, int st, int end)
Does nothing - output to /dev/null.
void
write(char[] chr)
Does nothing - output to /dev/null.
void
write(char[] chr, int st, int end)
Does nothing - output to /dev/null.
void
write(int idx)
Does nothing - output to /dev/null.

Field Details

NULL_WRITER

public static final NullWriter NULL_WRITER
A singleton.

Constructor Details

NullWriter

public NullWriter()
Constructs a new NullWriter.

Method Details

close

public void close()
See Also:
java.io.Writer.close()

flush

public void flush()
See Also:
java.io.Writer.flush()

write

public void write(String str)
Does nothing - output to /dev/null.
Parameters:
str - The string to write

write

public void write(String str,
                  int st,
                  int end)
Does nothing - output to /dev/null.
Parameters:
str - The string to write
st - The start offset
end - The number of characters to write

write

public void write(char[] chr)
Does nothing - output to /dev/null.
Parameters:
chr - The characters to write

write

public void write(char[] chr,
                  int st,
                  int end)
Does nothing - output to /dev/null.
Parameters:
chr - The characters to write
st - The start offset
end - The number of characters to write

write

public void write(int idx)
Does nothing - output to /dev/null.
Parameters:
idx - The character to write

Copyright (c) 2002-2009 Apache Software Foundation