public class NullOutputStream extends OutputStream
This output stream has no destination (file/socket etc.) and all bytes written to it are ignored and lost.
| Modifier and Type | Field and Description |
|---|---|
static NullOutputStream |
INSTANCE
The singleton instance.
|
static NullOutputStream |
NULL_OUTPUT_STREAM
Deprecated.
Use
INSTANCE. |
| Constructor and Description |
|---|
NullOutputStream()
Deprecated.
Use
INSTANCE. |
| 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 INSTANCE
@Deprecated public static final NullOutputStream NULL_OUTPUT_STREAM
INSTANCE.@Deprecated public NullOutputStream()
INSTANCE.INSTANCE.
TODO: Will be private in 3.0.public void write(byte[] b) throws IOException
/dev/null.write in class OutputStreamb - The bytes to writeIOException - neverpublic 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 writeCopyright © 2002–2023 The Apache Software Foundation. All rights reserved.