Home » openjdk-7 » java » io » [javadoc | source]
java.io
public class: PushbackReader [javadoc | source]
java.lang.Object
   java.io.Reader
      java.io.FilterReader
         java.io.PushbackReader

All Implemented Interfaces:
    Closeable, Readable

A character-stream reader that allows characters to be pushed back into the stream.
Fields inherited from java.io.FilterReader:
in
Fields inherited from java.io.Reader:
lock
Constructor:
 public PushbackReader(Reader in) 
    Creates a new pushback reader with a one-character pushback buffer.
    Parameters:
    in - The reader from which characters will be read
 public PushbackReader(Reader in,
    int size) 
    Creates a new pushback reader with a pushback buffer of the given size.
    Parameters:
    in - The reader from which characters will be read
    size - The size of the pushback buffer
    Throws:
    IllegalArgumentException - if size is <= 0
    exception: IllegalArgumentException - if size is <= 0
Method from java.io.PushbackReader Summary:
close,   mark,   markSupported,   read,   read,   ready,   reset,   skip,   unread,   unread,   unread
Methods from java.io.FilterReader:
close,   mark,   markSupported,   read,   read,   ready,   reset,   skip
Methods from java.io.Reader:
close,   mark,   markSupported,   read,   read,   read,   read,   ready,   reset,   skip
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from java.io.PushbackReader Detail:
 public  void close() throws IOException 
    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.
 public  void mark(int readAheadLimit) throws IOException 
    Marks the present position in the stream. The mark for class PushbackReader always throws an exception.
 public boolean markSupported() 
    Tells whether this stream supports the mark() operation, which it does not.
 public int read() throws IOException 
    Reads a single character.
 public int read(char[] cbuf,
    int off,
    int len) throws IOException 
    Reads characters into a portion of an array.
 public boolean ready() throws IOException 
    Tells whether this stream is ready to be read.
 public  void reset() throws IOException 
    Resets the stream. The reset method of PushbackReader always throws an exception.
 public long skip(long n) throws IOException 
    Skips characters. This method will block until some characters are available, an I/O error occurs, or the end of the stream is reached.
 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 (char)c.
 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 cbuf[0], the character after that will have the value cbuf[1], and so forth.
 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 cbuf[off], the character after that will have the value cbuf[off+1], and so forth.