Abstract class for reading character streams. The only methods that a
subclass must implement are read(char, int, int) and close(). Most
subclasses, however, will override some of the methods defined here in order
to provide higher efficiency, additional functionality, or both.
The object used to synchronize operations on this stream. For
efficiency, a character-stream object may use an object other than
itself to protect critical sections. A subclass should therefore use
the object in this field rather than this or a synchronized
Creates a new character-stream reader whose critical sections will
synchronize on the reader itself.
Attempts to read characters into the specified character buffer.
The buffer is used as a repository of characters as-is: the only
changes made are the results of a put operation. No flipping or
rewinding of the buffer is performed.
Resets the stream. If the stream has been marked, then attempt to
reposition it at the mark. If the stream has not been marked, then
attempt to reset it in some way appropriate to the particular stream,
for example by repositioning it to its starting point. Not all
character-input streams support the reset() operation, and some support
reset() without supporting mark().
IOException - If the stream has not been marked,
or if the mark has been invalidated,
or if the stream does not support reset(),
or if some other I/O error occurs
Closes the stream and releases any system resources associated with
it. Once the stream has been closed, further read(), ready(),
mark(), reset(), or skip() invocations will throw an IOException.
Closing a previously closed stream has no effect.
Submit a bug or feature For further API reference and developer documentation, see Java SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.