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 and all bytes written to it are ignored.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final NullOutputStreamThe singleton instance.static final NullOutputStreamDeprecated. -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class OutputStream
close, flush
-
Field Details
-
INSTANCE
-
NULL_OUTPUT_STREAM
Deprecated.UseINSTANCE.The singleton instance.
-
-
Constructor Details
-
Method Details
-
write
Does nothing.- Overrides:
writein classOutputStream- Parameters:
b- The This method ignores this parameter.- Throws:
IOException- This method never throws any exceptions.
-
write
No-op operation.Validates the arguments but does not write the data.
- Overrides:
writein classOutputStream- Parameters:
b- The byte array to write from, notnull.off- The offset to start at.len- The number of bytes to write.- Throws:
NullPointerException- Ifbisnull.IndexOutOfBoundsException- Ifofforlenare negative,off + lenis greater thanb.length.
-
write
Does nothing.- Specified by:
writein classOutputStream- Parameters:
b- This method ignores this parameter.
-
INSTANCE.