Closeable
, AutoCloseable
, Readable
PushbackReader
Abstract class for reading filtered character streams. The abstract class FilterReader
itself provides default methods that pass all requests to the contained stream. Subclasses of FilterReader
should override some of these methods and may also provide additional methods and fields.
Fields
The underlying character-input stream.
Constructors
protected
Creates a new filtered reader.
void
Closes the stream and releases any system resources associated with it.
void
Marks the present position in the stream.
boolean
Tells whether this stream supports the mark() operation.
int
Reads a single character.
int
read(char[] cbuf, int off, int len)
Reads characters into a portion of an array.
boolean
Tells whether this stream is ready to be read.
void
long
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
The underlying character-input stream.
Creates a new filtered reader.
in
- a Reader object providing the underlying stream.
NullPointerException
- if in
is null
Reads a single character.
read
in class Reader
0x00-0xffff
), or -1 if the end of the stream has been reached
IOException
- If an I/O error occurs
throws
IOExceptionIf len
is zero, then no characters are read and 0
is returned; otherwise, there is an attempt to read at least one character. If no character is available because the stream is at its end, the value -1
is returned; otherwise, at least one character is read and stored into cbuf
.
read
in class Reader
cbuf
- Destination buffer
off
- Offset at which to start storing characters
len
- Maximum number of characters to read
IndexOutOfBoundsException
- If off
is negative, or len
is negative, or len
is greater than cbuf.length - off
IOException
- If an I/O error occurs
Skips characters. This method will block until some characters are available, an I/O error occurs, or the end of the stream is reached. If the stream is already at its end before this method is invoked, then no characters are skipped and zero is returned.
skip
in class Reader
n
- The number of characters to skip
IllegalArgumentException
- If n
is negative and the contained Reader
's skip
method throws an IllegalArgumentException for a negative parameter
IOException
- If an I/O error occurs
Tells whether this stream is ready to be read.
ready
in class Reader
IOException
- If an I/O error occurs
public boolean markSupported()
Tells whether this stream supports the mark() operation.
markSupported
in class Reader
throws
IOExceptionMarks the present position in the stream.
mark
in class Reader
readAheadLimit
- Limit on the number of characters that may be read while still preserving the mark. After reading this many characters, attempting to reset the stream may fail.
IOException
- If an I/O error occurs
Resets the stream.
reset
in class Reader
IOException
- If an I/O error occurs
Reader
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.
close
in interface AutoCloseable
close
in interface Closeable
close
in class Reader
IOException
- If an I/O error occurs
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4