public class ClosedOutputStream
extends java.io.OutputStream
Typically uses of this class include testing for corner cases in methods that accept an output stream and acting as a
sentinel value instead of a null
output stream.
Modifier and Type | Field and Description |
---|---|
static ClosedOutputStream |
CLOSED_OUTPUT_STREAM
Deprecated.
Use
INSTANCE . |
static ClosedOutputStream |
INSTANCE
The singleton instance.
|
Constructor and Description |
---|
ClosedOutputStream() |
Modifier and Type | Method and Description |
---|---|
void |
flush()
Throws an
IOException to indicate that the stream is closed. |
void |
write(int b)
Throws an
IOException to indicate that the stream is closed. |
public static final ClosedOutputStream INSTANCE
@Deprecated public static final ClosedOutputStream CLOSED_OUTPUT_STREAM
INSTANCE
.public void flush() throws java.io.IOException
IOException
to indicate that the stream is closed.flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
- always thrownpublic void write(int b) throws java.io.IOException
IOException
to indicate that the stream is closed.write
in class java.io.OutputStream
b
- ignoredjava.io.IOException
- always thrownCopyright © 2010 - 2023 Adobe. All Rights Reserved