Package org.apache.commons.io.input
Class ClosedInputStream
java.lang.Object
java.io.InputStream
org.apache.commons.io.input.ClosedInputStream
- All Implemented Interfaces:
- Closeable,- AutoCloseable
Always returns 
IOUtils.EOF to all attempts to read something from an input 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
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final ClosedInputStreamDeprecated.static final ClosedInputStreamThe singleton instance.
- 
Constructor SummaryConstructors
- 
Method SummaryMethods inherited from class java.io.InputStreamavailable, close, mark, markSupported, read, reset, skip
- 
Field Details- 
INSTANCEThe singleton instance.- Since:
- 2.12.0
 
- 
CLOSED_INPUT_STREAMDeprecated.UseINSTANCE.The singleton instance.
 
- 
- 
Constructor Details- 
ClosedInputStreampublic ClosedInputStream()Constructs a new instance.
 
- 
- 
Method Details- 
readReturns-1to indicate that the stream is closed.- Specified by:
- readin class- InputStream
- Returns:
- always -1.
 
- 
readReturns-1to indicate that the stream is closed.- Overrides:
- readin class- InputStream
- Parameters:
- b- ignored.
- off- ignored.
- len- ignored.
- Returns:
- always -1.
- Throws:
- IOException
 
 
- 
INSTANCE.