Name

java.io.Reader

Synopsis

This abstract class is identical to the J2SE Reader class. It is the superclass for all classes that read character streams. The only methods that a Reader subclass must implement are the abstract read() and close() methods, although many implementations override other methods. Other important methods include skip(), which skips over the specified number of characters, and close(), which closes the input stream and releases any resources associated with it. Finally, the ready() method returns a Boolean, indicating if the stream can have more data read from it.

public abstract classReader {
   // protected fields
   protected Object lock;

   // constructors
   protected Reader();
   protected Reader(Object lock);

   // public instance methods
   public abstract void close() throws java.io.IOException;
   public void mark(int readAheadLimit) throws java.io.IOException;
   public boolean markSupported();
   public int read() throws java.io.IOException;
   public int read(char[] cbuf) throws java.io.IOException;
   public abstract int read(char[] cbuf, int off, int len)
      throws java.io.IOException;
   public boolean ready() throws java.io.IOException;
   public void reset() throws java.io.IOException;
   public long skip(long n) throws java.io.IOException;
}

Get Wireless Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.