public class NullOutputStream extends OutputStream
OutputStream that discards all bytes to be written| Modifier and Type | Field and Description |
|---|---|
static NullOutputStream |
NULL_OUTPUT_STREAM
A singleton.
|
| Constructor and Description |
|---|
NullOutputStream()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Does not nothing and therefore does not throw an Exception.
|
void |
flush()
Does not nothing and therefore does not throw an Exception.
|
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. |
public static final NullOutputStream NULL_OUTPUT_STREAM
public NullOutputStream()
NULL_OUTPUT_STREAM instead.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 - neverpublic void flush()
flush in interface Flushableflush in class OutputStreampublic void close()
close in interface Closeableclose in interface AutoCloseableclose in class OutputStreamCopyright © 2014–2019 Philip Helger. All rights reserved.