public class NullOutputStream
extends java.io.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 |
|---|---|
private static NullOutputStream |
INSTANCE |
static NullOutputStream |
NULL_OUTPUT_STREAM
Deprecated.
Deprecated in 2.7: use
getInstance(). |
| Modifier | Constructor and Description |
|---|---|
private |
NullOutputStream() |
| Modifier and Type | Method and Description |
|---|---|
static NullOutputStream |
getInstance()
Gets the singleton instance.
|
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. |
private static final NullOutputStream INSTANCE
@Deprecated public static final NullOutputStream NULL_OUTPUT_STREAM
getInstance().public static NullOutputStream getInstance()
public void write(byte[] b,
int off,
int len)
/dev/null.write in class java.io.OutputStreamb - The bytes to writeoff - The start offsetlen - The number of bytes to writepublic void write(int b)
/dev/null.write in class java.io.OutputStreamb - The byte to writepublic void write(byte[] b)
throws java.io.IOException
/dev/null.write in class java.io.OutputStreamb - The bytes to writejava.io.IOException - never