java.io
Class FilterInputStream

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--java.io.FilterInputStream
Direct Known Subclasses:
BufferedInputStream, DataInputStream

public class FilterInputStream
extends InputStream

A FilterInputStream contains another input stream, which it uses as its basic data source, possibly transforming the data before it is passed to the application.


Constructor Summary
FilterInputStream(InputStream is)
          Creates a new instance of FilterInputStream.
 
Method Summary
 int available()
          Returns the number of bytes that can be read without blocking.
 void close()
          Closes the underlying input stream and releases all system resources associated with it.
 int read()
          Reads a single byte from the underlying input stream.
 int read(byte[] b)
          Reads up to b.length bytes from the underlying stream into b.
 
Methods inherited from class java.io.InputStream
read, skip
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, toString
 

Constructor Detail

FilterInputStream

public FilterInputStream(InputStream is)
Creates a new instance of FilterInputStream. The passed input stream is stored and used for input.

Parameters:
is - Input stream to read data from.
Method Detail

available

public int available()
              throws IOException
Returns the number of bytes that can be read without blocking.

Overrides:
available in class InputStream
Returns:
Number of bytes that can be read without blocking.
IOException

close

public void close()
           throws IOException
Closes the underlying input stream and releases all system resources associated with it.

Overrides:
close in class InputStream
IOException

read

public int read()
         throws IOException
Reads a single byte from the underlying input stream.

Specified by:
read in class InputStream
Returns:
The next byte of data; -1 if the end of the stream is reached.
Throws:
IOException - if an I/O error occurs.

read

public int read(byte[] b)
         throws IOException
Reads up to b.length bytes from the underlying stream into b.

Overrides:
read in class InputStream
Parameters:
b - Array to be filled with data read.
Returns:
The number of bytes read; -1 if there are no more bytes to read.
Throws:
IOException - if an I/O error occurs.