Modifier and Type | Field and Description |
---|---|
private char[] | buf
Pushback buffer |
private int | pos
Current position in buffer |
Access | Constructor and Description |
---|---|
public | PushbackReader(Reader
The reader from which characters will be read in, int The size of the pushback buffer size)Creates a new pushback reader with a pushback buffer of the given size. |
public | PushbackReader(Reader
The reader from which characters will be read in)Creates a new pushback reader with a one-character pushback buffer. |
Modifier and Type | Method and Description |
---|---|
public void | close()
Overrides java. Implements java. Closes the stream and releases any system resources associated with it. |
private void | |
public void | mark(int
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. readAheadLimit)Overrides java. Marks the present position in the stream. |
public boolean | markSupported()
Overrides java. Tells whether this stream supports the mark() operation, which it does not. |
public int | Returns: The character read, or -1 if the end of the stream has been reachedOverrides java. Reads a single character. |
public int | read(char[]
Destination buffer cbuf, int Offset at which to start storing characters off, int Maximum number of characters to read len)Overrides java. Reads characters into a portion of an array. |
public boolean | |
public void | |
public long | |
public void | unread(int
The int value representing a character to be pushed back c)Pushes back a single character by copying it to the front of the pushback buffer. |
public void | unread(char[]
Character array cbuf, int Offset of first character to push back off, int Number of characters to push back len)Pushes back a portion of an array of characters by copying it to the front of the pushback buffer. |
public void | unread(char[]
Character array to push back cbuf)Pushes back an array of characters by copying it to the front of the pushback buffer. |
buf | back to summary |
---|---|
private char[] buf Pushback buffer |
pos | back to summary |
---|---|
private int pos Current position in buffer |
PushbackReader | back to summary |
---|---|
public PushbackReader(Reader in, int size) Creates a new pushback reader with a pushback buffer of the given size.
|
PushbackReader | back to summary |
---|---|
public PushbackReader(Reader in) Creates a new pushback reader with a one-character pushback buffer.
|
close | back to summary |
---|---|
public void close() throws IOException Overrides java. Implements java. 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.
|
ensureOpen | back to summary |
---|---|
private void ensureOpen() throws IOException Checks to make sure that the stream has not been closed. |
mark | back to summary |
---|---|
public void mark(int readAheadLimit) throws IOException Overrides java. Marks the present position in the stream. The
|
markSupported | back to summary |
---|---|
public boolean markSupported() Overrides java. Tells whether this stream supports the mark() operation, which it does not.
|
read | back to summary |
---|---|
public int read() throws IOException Overrides java. Reads a single character.
|
read | back to summary |
---|---|
public int read(char[] cbuf, int off, int len) throws IOException Overrides java. Doc from java. Reads characters into a portion of an array. This method will block until some input is available, an I/O error occurs, or the end of the stream is reached. If
|
ready | back to summary |
---|---|
public boolean ready() throws IOException Overrides java. Tells whether this stream is ready to be read.
|
reset | back to summary |
---|---|
public void reset() throws IOException Overrides java. Resets the stream. The
|
skip | back to summary |
---|---|
public long skip(long n) throws IOException Overrides java. Doc from java. 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.
|
unread | back to summary |
---|---|
public void unread(int c) throws IOException 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
|
unread | back to summary |
---|---|
public void unread(char[] cbuf, int off, int len) throws IOException Pushes 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
|
unread | back to summary |
---|---|
public void unread(char[] cbuf) throws IOException 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
|