Reader (Java SE 25 & JDK 25)
- All Implemented Interfaces:
Closeable, AutoCloseable, Readable
- Direct Known Subclasses:
BufferedReader, CharArrayReader, FilterReader, InputStreamReader, PipedReader, StringReader
-
Field Summary
Fields
The object used to synchronize operations on this stream.
-
Constructor Summary
Constructors
protectedReader()Creates a new character-stream reader whose critical sections will synchronize on the reader itself.
protectedCreates a new character-stream reader whose critical sections will synchronize on the given object.
-
Method Summary
abstract voidclose()Closes the stream and releases any system resources associated with it.
voidmark(int readAheadLimit) Marks the present position in the stream.
booleanTells whether this stream supports the mark() operation.
Returns a new
Readerthat reads no characters.Returns a
Readerthat reads characters from aCharSequence.intread()Reads a single character.
intread(char[] cbuf) Reads characters into an array.
abstract intread(char[] cbuf, int off, int len) Reads characters into a portion of an array.
intAttempts to read characters into the specified character buffer.
Reads all remaining characters into a string.
Reads all remaining characters as lines of text.
booleanready()Tells whether this stream is ready to be read.
voidreset()longskip(long n) longReads all characters from this reader and writes the characters to the given writer in the order that they are read.
-
Field Details
-
lock
-
-
Constructor Details
-
Reader
-
Reader
-
-
Method Details
-
nullReader
-
of
-
read
-
read
-
read
-
read
-
readAllLines
-
readAllAsString
-
skip
-
ready
-
markSupported
-
mark
-
reset
-
close
-
transferTo
-