Package it.unimi.dsi.io
Class NullReader
java.lang.Object
java.io.Reader
it.unimi.dsi.io.NullReader
- All Implemented Interfaces:
Closeable
,Serializable
,AutoCloseable
,Readable
End-of-stream-only reader.
This reader will always return end-of-file on any read attempt.
This class is a singleton. You cannot create a null reader,
but you can obtain an instance of this class using getInstance()
.
- Since:
- 0.9.2
- Author:
- Sebastiano Vigna
- See Also:
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
static NullReader
Returns the only instance of this class.int
read
(char[] cbuf, int off, int len) Methods inherited from class java.io.Reader
mark, markSupported, nullReader, read, read, read, ready, reset, skip, transferTo
-
Method Details
-
getInstance
Returns the only instance of this class.- Returns:
- the only instance of this class.
-
close
public void close() -
read
public int read(char[] cbuf, int off, int len)
-