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 Summary
FieldsModifier and TypeFieldDescriptionstatic final ClosedReaderDeprecated.static final ClosedReaderThe singleton instance. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
INSTANCE
The singleton instance.- Since:
- 2.12.0
-
CLOSED_READER
Deprecated.The singleton instance.
-
-
Constructor Details
-
ClosedReader
public ClosedReader()
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classReader- Throws:
IOException
-
read
Returns -1 to indicate that the stream is closed.
-
INSTANCE.