public class NullOutputStream extends OutputStream
This output stream has no destination (file/socket etc.) and all bytes written to it are ignored and lost.
Originally from Apache Commons IO.| Modifier and Type | Field and Description |
|---|---|
static NullOutputStream |
NULL_OUTPUT_STREAM
A singleton.
|
| Constructor and Description |
|---|
NullOutputStream() |
| Modifier and Type | Method and Description |
|---|---|
void |
write(byte[] b)
Does nothing - output to
/dev/null. |
void |
write(byte[] b,
int off,
int len)
Does nothing - output to
/dev/null. |
void |
write(int b)
Does nothing - output to
/dev/null. |
close, flushpublic static final NullOutputStream NULL_OUTPUT_STREAM
public NullOutputStream()
public void write(byte[] b, int off, int len)
/dev/null.write in class OutputStreamb - The bytes to writeoff - The start offsetlen - The number of bytes to writepublic void write(int b)
/dev/null.write in class OutputStreamb - The byte to writepublic void write(byte[] b) throws IOException
/dev/null.write in class OutputStreamb - The bytes to writeIOException - neverCopyright © 1999-2021 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.