Team LiB
Previous Section Next Section

Java 1.0closeable

This class is a FilterInputStream that provides input data buffering; efficiency is increased by reading in a large amount of data and storing it in an internal buffer. When data is requested, it is usually available from the buffer. Thus, most calls to read data do not actually have to read data from a disk, network, or other slow source. Create a BufferedInputStream by specifying the InputStream that is to be buffered in the call to the constructor. See also BufferedReader.

Figure 9-1.

public class BufferedInputStream extends FilterInputStream {
// Public Constructors
     public BufferedInputStream(InputStream in);  
     public BufferedInputStream(InputStream in, int size);  
// Public Methods Overriding FilterInputStream
     public int available( ) throws IOException;                    synchronized
1.2  public void close( ) throws IOException;  
     public void mark(int readlimit);                synchronized
     public boolean markSupported( );                                     constant
     public int read( ) throws IOException;                         synchronized
     public int read(byte[ ] b, int off, int len) throws IOException;     synchronized
     public void reset( ) throws IOException;                       synchronized
     public long skip(long n) throws IOException;                 synchronized
// Protected Instance Fields
     protected volatile byte[ ] buf;  
     protected int count;  
     protected int marklimit;  
     protected int markpos;  
     protected int pos;  

    Team LiB
    Previous Section Next Section