public class ClosedInputStream extends InputStream
IOUtils.EOF
to all attempts to read something from the stream.
Typically uses of this class include testing for corner cases in methods that accept input streams and acting as a
sentinel value instead of a null
input stream.
Modifier and Type | Field and Description |
---|---|
static ClosedInputStream |
CLOSED_INPUT_STREAM
Deprecated.
Use
INSTANCE . |
static ClosedInputStream |
INSTANCE
The singleton instance.
|
Constructor and Description |
---|
ClosedInputStream() |
Modifier and Type | Method and Description |
---|---|
int |
read()
Returns -1 to indicate that the stream is closed.
|
available, close, mark, markSupported, read, read, reset, skip
public static final ClosedInputStream INSTANCE
@Deprecated public static final ClosedInputStream CLOSED_INPUT_STREAM
INSTANCE
.public ClosedInputStream()
public int read()
read
in class InputStream
Copyright © 2002–2023 The Apache Software Foundation. All rights reserved.