Name

java.io.InputStream

Synopsis

This abstract class is identical to the J2SE InputStream class. All input streams must extend this class. Applications that define a subclass of InputStream must always implement the abstract read() method, which reads in a single byte of data or -1 if there is no more data to be read. Other important methods include available(), which returns the number of available bytes that can be read without blocking, as well as skip(), which skips over the specified number of bytes. Finally, close() will close the input stream, releasing any resources associated with it.

public abstract classInputStream {
   // constructor
   public InputStream();

   // public instance methods
   public int available() throws java.io.IOException;
   public void close();
   public synchronized void mark(int readlimit);
   public boolean markSupported();
   public abstract int read() throws java.io.IOException;
   public int read(byte[] b) throws java.io.IOException;
   public int read(byte[] b, int off, int len) throws java.io.IOException;
   public synchronized 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.