- Direct Known Subclasses:
public abstract class FilterReader extends Reader
Abstract class for reading filtered character streams. The abstract class
FilterReaderitself provides default methods that pass all requests to the contained stream. Subclasses of
FilterReadershould override some of these methods and may also provide additional methods and fields.
Fields Modifier and Type Field Description
protected ReaderThe underlying character-input stream.
Constructors Modifier Constructor Description
Reader in)(Creates a new filtered reader.
Modifier and Type Method Description
(int readAheadLimit)Marks the present position in the stream.
()Tells whether this stream supports the mark() operation.
()Reads a single character.
(char cbuf, int off, int len)Reads characters into a portion of an array.
()Tells whether this stream is ready to be read.
()Resets the stream.
(long n)Skips characters.
inprotected Reader inThe underlying character-input stream.
readpublic int read() throws IOExceptionReads a single character.
readpublic int read(char cbuf, int off, int len) throws IOExceptionReads characters into a portion of an array.
- Specified by:
cbuf- Destination buffer
off- Offset at which to start storing characters
len- Maximum number of characters to read
- The number of characters read, or -1 if the end of the stream has been reached
IOException- If an I/O error occurs
offis negative, or
lenis negative, or
lenis greater than
cbuf.length - off
skippublic long skip(long n) throws IOExceptionSkips characters.
readypublic boolean ready() throws IOExceptionTells whether this stream is ready to be read.
markSupportedpublic boolean markSupported()Tells whether this stream supports the mark() operation.
markpublic void mark(int readAheadLimit) throws IOExceptionMarks the present position in the stream.
resetpublic void reset() throws IOExceptionResets the stream.