Package org.apache.commons.io.output
Class NullWriter
java.lang.Object
java.io.Writer
org.apache.commons.io.output.NullWriter
- All Implemented Interfaces:
- Closeable,- Flushable,- Appendable,- AutoCloseable
Never writes data. Calls never go beyond this class.
 
 This Writer has no destination (file/socket etc.) and all characters written to it are ignored and lost.
 
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final NullWriterThe singleton instance.static final NullWriterDeprecated.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionappend(char c) Does nothing - output to/dev/null.append(CharSequence csq) Does nothing - output to/dev/null.append(CharSequence csq, int start, int end) Does nothing - output to/dev/null.voidclose()voidflush()voidwrite(char[] chr) Does nothing - output to/dev/null.voidwrite(char[] chr, int st, int end) Does nothing - output to/dev/null.voidwrite(int b) Does nothing - output to/dev/null.voidDoes nothing - output to/dev/null.voidDoes nothing - output to/dev/null.
- 
Field Details- 
INSTANCEThe singleton instance.- Since:
- 2.12.0
 
- 
NULL_WRITERDeprecated.UseINSTANCE.The singleton instance.
 
- 
- 
Constructor Details- 
NullWriterDeprecated.UseINSTANCE.Constructs a new NullWriter.
 
- 
- 
Method Details- 
appendDoes nothing - output to/dev/null.- Specified by:
- appendin interface- Appendable
- Overrides:
- appendin class- Writer
- Parameters:
- c- The character to write
- Returns:
- this writer
- Since:
- 2.0
 
- 
appendDoes nothing - output to/dev/null.- Specified by:
- appendin interface- Appendable
- Overrides:
- appendin class- Writer
- Parameters:
- csq- The character sequence to write
- Returns:
- this writer
- Since:
- 2.0
 
- 
appendDoes nothing - output to/dev/null.- Specified by:
- appendin interface- Appendable
- Overrides:
- appendin class- Writer
- Parameters:
- csq- The character sequence to write
- start- The index of the first character to write
- end- The index of the first character to write (exclusive)
- Returns:
- this writer
- Since:
- 2.0
 
- 
close
- 
flush
- 
writeDoes nothing - output to/dev/null.
- 
writeDoes nothing - output to/dev/null.
- 
writeDoes nothing - output to/dev/null.
- 
writeDoes nothing - output to/dev/null.
- 
writeDoes nothing - output to/dev/null.
 
- 
INSTANCE.