- 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.
Field SummaryModifier and TypeFieldDescription
protected ReaderThe underlying character-input stream.
Reader in)(Creates a new filtered reader.
Method SummaryModifier and TypeMethodDescription
()Closes the stream and releases any system resources associated with it.
(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.
closepublic void close() throws IOExceptionDescription copied from class:
ReaderCloses 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.