java.io.PushbackReader (JDK 1.1)
This class is a character input stream that uses another input stream as its input source, and adds the ability to push characters back onto the stream. This feature is often useful when writing parsers.
When you create a PushbackReader stream, you specify the stream to be read from, and may optionally specify the size of the pushback buffer--i.e., the number of characters that may be pushed back onto the stream or "unread." If you do not specify a size for this buffer, the default size is one character.
PushbackReader inherits or overrides all the standard Reader methods, and also adds three unread() methods that are used to push a single character, an array of characters, or a portion of an array of characters back onto the stream.
This class is the character stream analog of PushbackInputStream.
public classPushbackReaderextends FilterReader { //Public ConstructorspublicPushbackReader(Readerin, intsize); publicPushbackReader(Readerin); //Public Instance Methodspublic voidclose() throws IOException; //Overrides FilterReaderpublic booleanmarkSupported(); //Overrides FilterReaderpublic intread() throws IOException; //Overrides FilterReaderpublic intread(char[]cbuf, intoff, intlen) throws IOException; //Overrides FilterReaderpublic booleanready() throws IOException; //Overrides FilterReaderpublic voidunread(intc) throws IOException; public voidunread(char[]cbuf, intoff, intlen) throws IOException; public voidunread(char[]cbuf) throws IOException; }
Hierarchy:
Object->Reader->FilterReader->PushbackReader