|
JavaTM 2 Platform Std. Ed. v1.3 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.io.Reader
|
+--java.io.FilterReader
|
+--java.io.PushbackReader
A character-stream reader that allows characters to be pushed back into the stream.
| Fields inherited from class java.io.FilterReader |
in |
| Fields inherited from class java.io.Reader |
lock |
| Constructor Summary | |
PushbackReader(Reader in)
Create a new pushback reader with a one-character pushback buffer. |
|
PushbackReader(Reader in,
int size)
Create a new pushback reader with a pushback buffer of the given size. |
|
| Method Summary | |
void |
close()
Close the stream. |
void |
mark(int readAheadLimit)
Mark the present position in the stream. |
boolean |
markSupported()
Tell whether this stream supports the mark() operation, which it does not. |
int |
read()
Read a single character. |
int |
read(char[] cbuf,
int off,
int len)
Read characters into a portion of an array. |
boolean |
ready()
Tell whether this stream is ready to be read. |
void |
reset()
Reset the stream. |
void |
unread(char[] cbuf)
Push back an array of characters by copying it to the front of the pushback buffer. |
void |
unread(char[] cbuf,
int off,
int len)
Push back a portion of an array of characters by copying it to the front of the pushback buffer. |
void |
unread(int c)
Push back a single character. |
| Methods inherited from class java.io.FilterReader |
skip |
| Methods inherited from class java.io.Reader |
read |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PushbackReader(Reader in,
int size)
in - The reader from which characters will be readsize - The size of the pushback bufferIllegalArgumentException - if size is <= 0public PushbackReader(Reader in)
in - The reader from which characters will be read| Method Detail |
public int read()
throws IOException
read in class FilterReaderIOException - If an I/O error occurs
public int read(char[] cbuf,
int off,
int len)
throws IOException
read in class FilterReadercbuf - Destination bufferoff - Offset at which to start writing characterslen - Maximum number of characters to readIOException - If an I/O error occurs
public void unread(int c)
throws IOException
c - The character to push backIOException - If the pushback buffer is full,
or if some other I/O error occurs
public void unread(char[] cbuf,
int off,
int len)
throws IOException
cbuf[off], the
character after that will have the value cbuf[off+1], and
so forth.cbuf - Character arrayoff - Offset of first character to push backlen - Number of characters to push backIOException - If there is insufficient room in the pushback
buffer, or if some other I/O error occurs
public void unread(char[] cbuf)
throws IOException
cbuf[0], the character after that
will have the value cbuf[1], and so forth.cbuf - Character array to push backIOException - If there is insufficient room in the pushback
buffer, or if some other I/O error occurs
public boolean ready()
throws IOException
ready in class FilterReaderIOException - If an I/O error occurs
public void mark(int readAheadLimit)
throws IOException
mark
for class PushbackReader always throws an exception.mark in class FilterReaderIOException - Always, since mark is not supported
public void reset()
throws IOException
reset method of
PushbackReader always throws an exception.reset in class FilterReaderIOException - Always, since reset is not supportedpublic boolean markSupported()
markSupported in class FilterReaderjava.io.Reader
public void close()
throws IOException
close in class FilterReaderIOException - If an I/O error occurs
|
JavaTM 2 Platform Std. Ed. v1.3 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.