java.io.Closeable
, java.io.Flushable
, java.lang.AutoCloseable
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 | Description |
---|---|---|
static ClosedOutputStream |
CLOSED_OUTPUT_STREAM |
A singleton.
|
Constructor | Description |
---|---|
ClosedOutputStream() |
Modifier and Type | Method | Description |
---|---|---|
void |
write(int b) |
Throws an
IOException to indicate that the stream is closed. |
public static final ClosedOutputStream CLOSED_OUTPUT_STREAM
Copyright (c) 2002-2017 Apache Software Foundation