Package org.apache.commons.io.input
Class ClosedInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.apache.commons.io.input.ClosedInputStream
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class ClosedInputStream extends java.io.InputStream
Closed input stream. This stream returns -1 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.- Since:
- 1.4
- Version:
- $Id: ClosedInputStream.java 1307459 2012-03-30 15:11:44Z ggregory $
-
-
Field Summary
Fields Modifier and Type Field Description static ClosedInputStream
CLOSED_INPUT_STREAM
A singleton.
-
Constructor Summary
Constructors Constructor Description ClosedInputStream()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
read()
Returns -1 to indicate that the stream is closed.
-
-
-
Field Detail
-
CLOSED_INPUT_STREAM
public static final ClosedInputStream CLOSED_INPUT_STREAM
A singleton.
-
-