Package org.apache.commons.io.input
Class ClosedReader
java.lang.Object
java.io.Reader
org.apache.commons.io.input.ClosedReader
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- Readable
Always returns 
IOUtils.EOF to all attempts to read something from it.
 
 Typically uses of this class include testing for corner cases in methods that accept readers and acting as a sentinel
 value instead of a null reader.
 
- Since:
- 2.7
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final ClosedReaderDeprecated.static final ClosedReaderThe singleton instance.
- 
Constructor SummaryConstructors
- 
Method Summary
- 
Field Details- 
INSTANCEThe singleton instance.- Since:
- 2.12.0
 
- 
CLOSED_READERDeprecated.The singleton instance.
 
- 
- 
Constructor Details- 
ClosedReaderpublic ClosedReader()Construct a new instance.
 
- 
- 
Method Details- 
close- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Specified by:
- closein class- Reader
- Throws:
- IOException
 
- 
readReturns -1 to indicate that the stream is closed.
 
- 
INSTANCE.