Package org.apache.commons.io.output
Class NullOutputStream
java.lang.Object
java.io.OutputStream
org.apache.commons.io.output.NullOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
Never writes data. Calls never go beyond this class.
This output stream has no destination (file/socket etc.) and all bytes written to it are ignored and lost.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final NullOutputStream
The singleton instance.static final NullOutputStream
Deprecated. -
Constructor Summary
-
Method Summary
Methods inherited from class java.io.OutputStream
close, flush
-
Field Details
-
INSTANCE
The singleton instance.- Since:
- 2.12.0
-
NULL_OUTPUT_STREAM
Deprecated.UseINSTANCE
.The singleton instance.
-
-
Constructor Details
-
Method Details
-
write
Does nothing - output to/dev/null
.- Overrides:
write
in classOutputStream
- Parameters:
b
- The bytes to write- Throws:
IOException
- never
-
write
Does nothing - output to/dev/null
.- Overrides:
write
in classOutputStream
- Parameters:
b
- The bytes to writeoff
- The start offsetlen
- The number of bytes to write
-
write
Does nothing - output to/dev/null
.- Specified by:
write
in classOutputStream
- Parameters:
b
- The byte to write
-
INSTANCE
.