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
Methods inherited from class Reader
mark, markSupported, nullReader, of, read, read, read, readAllAsString, readAllLines, ready, reset, skip, transferTo
-
Field Details
-
INSTANCE
-
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
-
INSTANCE.