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 Summary
Modifier and TypeFieldDescriptionstatic final NullWriter
The singleton instance.static final NullWriter
Deprecated. -
Constructor Summary
-
Method Summary
Modifier 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
.void
close()
void
flush()
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
.void
Does nothing - output to/dev/null
.void
Does nothing - output to/dev/null
.
-
Field Details
-
INSTANCE
The singleton instance.- Since:
- 2.12.0
-
NULL_WRITER
Deprecated.UseINSTANCE
.The singleton instance.
-
-
Constructor Details
-
NullWriter
Deprecated.UseINSTANCE
.Constructs a new NullWriter.
-
-
Method Details
-
append
Does nothing - output to/dev/null
.- Specified by:
append
in interfaceAppendable
- Overrides:
append
in classWriter
- Parameters:
c
- The character to write- Returns:
- this writer
- Since:
- 2.0
-
append
Does nothing - output to/dev/null
.- Specified by:
append
in interfaceAppendable
- Overrides:
append
in classWriter
- Parameters:
csq
- The character sequence to write- Returns:
- this writer
- Since:
- 2.0
-
append
Does nothing - output to/dev/null
.- Specified by:
append
in interfaceAppendable
- Overrides:
append
in classWriter
- Parameters:
csq
- The character sequence to writestart
- The index of the first character to writeend
- The index of the first character to write (exclusive)- Returns:
- this writer
- Since:
- 2.0
-
close
-
flush
-
write
Does nothing - output to/dev/null
. -
write
Does nothing - output to/dev/null
. -
write
Does nothing - output to/dev/null
. -
write
Does nothing - output to/dev/null
. -
write
Does nothing - output to/dev/null
.
-
INSTANCE
.