Closeable
, AutoCloseable
, Readable
A character-stream reader that allows characters to be pushed back into the stream.
Constructors
Creates a new pushback reader with a one-character pushback buffer.
Creates a new pushback reader with a pushback buffer of the given size.
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, which it does not.
int
Reads a single character.
boolean
Tells whether this stream is ready to be read.
void
void
Pushes back an array of characters by copying it to the front of the pushback buffer.
void
unread(char[] cbuf, int off, int len)
Pushes back a portion of an array of characters by copying it to the front of the pushback buffer.
void
Pushes back a single character by copying it to the front of the pushback buffer.
Methods declared in class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Creates a new pushback reader with a pushback buffer of the given size.
in
- The reader from which characters will be read
size
- The size of the pushback buffer
IllegalArgumentException
- if size <= 0
Creates a new pushback reader with a one-character pushback buffer.
in
- The reader from which characters will be read
Reads a single character.
read
in class FilterReader
IOException
- If an I/O error occurs
Pushes back a single character by copying it to the front of the pushback buffer. After this method returns, the next character to be read will have the value (char)c
.
c
- The int value representing a character to be pushed back
IOException
- If the pushback buffer is full, or if some other I/O error occurs
throws
IOExceptionPushes back a portion of an array of characters by copying it to the front of the pushback buffer. After this method returns, the next character to be read will have the value cbuf[off]
, the character after that will have the value cbuf[off+1]
, and so forth.
cbuf
- Character array
off
- Offset of first character to push back
len
- Number of characters to push back
IOException
- If there is insufficient room in the pushback buffer, or if some other I/O error occurs
Pushes back an array of characters by copying it to the front of the pushback buffer. After this method returns, the next character to be read will have the value cbuf[0]
, the character after that will have the value cbuf[1]
, and so forth.
cbuf
- Character array to push back
IOException
- If there is insufficient room in the pushback buffer, or if some other I/O error occurs
Tells whether this stream is ready to be read.
ready
in class FilterReader
IOException
- If an I/O error occurs
throws
IOExceptionMarks the present position in the stream. The mark
for class PushbackReader
always throws an exception.
mark
in class FilterReader
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
- Always, since mark is not supported
Resets the stream. The reset
method of PushbackReader
always throws an exception.
reset
in class FilterReader
IOException
- Always, since reset is not supported
public boolean markSupported()
Tells whether this stream supports the mark() operation, which it does not.
markSupported
in class FilterReader
Closes the stream and releases any system resources associated with it. Once the stream has been closed, further read(), unread(), ready(), or skip() invocations will throw an IOException. Closing a previously closed stream has no effect. This method will block while there is another thread blocking on the reader.
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