public class NullOutputStream
extends java.io.OutputStream
"dev/null" output stream - an output stream implementation that discards all the
data written to it. This implementation is not thread-safe.
Note that once a null output stream instance is closed, any subsequent attempts
to write the data to the closed stream result in an IOException being thrown.| Modifier and Type | Field and Description |
|---|---|
private boolean |
isClosed |
| Constructor and Description |
|---|
NullOutputStream() |
| Modifier and Type | Method and Description |
|---|---|
private void |
checkClosed() |
void |
close() |
void |
flush() |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
public void write(int b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void write(byte[] b,
int off,
int len)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.OutputStreamjava.io.IOExceptionprivate void checkClosed()
throws java.io.IOException
java.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.OutputStreamjava.io.IOException