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
Modifier and TypeFieldDescriptionstatic final ClosedReader
Deprecated.static final ClosedReader
The singleton instance. -
Constructor Summary
-
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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classReader
- Throws:
IOException
-
read
Returns -1 to indicate that the stream is closed.
-
INSTANCE
.