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 NullWriterNULL_WRITER
A singleton.
Constructor Summary
NullWriter()
Constructs a new NullWriter.
Method Summary
voidclose()
voidflush()
voidwrite(int idx)
Does nothing - output to /dev/null.
voidwrite(char[] chr)
Does nothing - output to /dev/null.
voidwrite(char[] chr, int st, int end)
Does nothing - output to /dev/null.
voidwrite(String str)
Does nothing - output to /dev/null.
voidwrite(String str, int st, int end)
Does nothing - output to /dev/null.

Field Detail

NULL_WRITER

public static final NullWriter NULL_WRITER
A singleton.

Constructor Detail

NullWriter

public NullWriter()
Constructs a new NullWriter.

Method Detail

close

public void close()

See Also: java.io.Writer#close()

flush

public void flush()

See Also: java.io.Writer#flush()

write

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

Parameters: idx The character 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(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

Copyright (c) 2002-2011 Apache Software Foundation