java.io.FilterInputStream
java.io.InputStream
java.io.BufferedInputStream,
java.io.DataInputStream,
java.io.LineNumberInputStream,
java.io.PushbackInputStream,
java.util.zip.CheckedInputStream,
java.util.zip.InflaterInputStream
None
JDK 1.0 or later
The FilterInputStream class is the superclass of all of the input stream classes that filter input. Each of the subclasses of FilterInputStream works by wrapping an existing input stream, called the underlying input stream, and providing additional functionality. The methods of FilterInputStream simply override the methods of InputStream with versions that call the corresponding methods of the underlying stream.
FilterInputStream cannot be instantiated directly; it must be subclassed. An instance of one of the subclasses of FilterInputStream is constructed with another InputStream object. The methods of a subclass of FilterInputStream should override some methods in order to extend their behavior or provide some sort of filtering.
public class java.io.FilterInputStream extends java.io.InputStream { // Variables protected InputStream in; // Constructors protected FilterInputStream(InputStream in); // Instance Methods public int available(); public void close(); public synchronized void mark(int readlimit); public boolean markSupported(); public int read(); public int read(byte[] b); public int read(byte[] b, int off, int len); public synchronized void reset(); public long skip(long n); }
The underlying stream that this FilterInputStream wraps or filters.
The input stream to filter.
This constructor creates a FilterInputStream that gets its data from in.
The number of bytes that can be read without blocking.
If any kind of I/O error occurs.
InputStream.available()
This method calls the available() method of the underlying stream and returns the result.
If any kind of I/O error occurs.
InputStream.close()
This method calls the close() method of the underlying stream, which releases any system resources associated with this object.
The maximum number of bytes that can be read before the saved position becomes invalid.
InputStream.mark()
This method calls the mark() method of the underlying stream. If the underlying stream supports mark() and reset(), this method causes the FilterInputStream to remember its current position. A subsequent call to reset() causes the object to return to that saved position, and thus re-read a portion of the input.
true if this stream supports mark() and reset(); false otherwise.
InputStream.markSupported()
This method calls the markSupported() method of the underlying stream and returns the result.
The next byte of data or -1 if the end of the stream is encountered.
If any kind of I/O error occurs.
InputStream.read()
This method calls the read() method of the underlying stream and returns the result. This method blocks until some data is available, the end of the stream is detected, or an exception is thrown.
An array of bytes to be filled from the stream.
The actual number of bytes read or -1 if the end of the stream is encountered immediately.
If any kind of I/O error occurs.
InputStream.read(byte[])
This method reads bytes of input to fill the given array. It does this by calling read(b, 0, b.length), which allows subclasses to only override read(byte[], int, int) and have read(byte[]) work automatically. The method blocks until some data is available.
An array of bytes to be filled from the stream.
An offset into the byte array.
The number of bytes to read.
The actual number of bytes read or -1 if the end of the stream is encountered immediately.
If any kind of I/O error occurs.
InputStream.read(byte[], int, int)
This method reads up to len bytes of input into the given array starting at index off. It does this by calling the read(byte[], int, int) method of the underlying stream and returning the result. The method blocks until some data is available.
If there was no previous call to the mark() method or the saved position has been invalidated.
InputStream.reset()
This method calls the reset() method of the underlying stream. If the underlying stream supports mark() and reset(), this method sets the position of the FilterInputStream to a position that was saved by a previous call to mark(). Subsequent bytes read from this FilterInputStream will begin from the saved position and continue normally.
The number of bytes to skip.
The actual number of bytes skipped.
If any kind of I/O error occurs.
InputStream.skip()
This method skips n bytes of input. It calls the skip() method of the underlying stream.
Method |
Inherited From |
Method |
Inherited From |
---|---|---|---|
clone() |
Object |
equals(Object) |
Object |
finalize() |
Object |
getClass() |
Object |
hashCode() |
Object |
notify() |
Object |
notifyAll() |
Object |
toString() |
Object |
wait() |
Object |
wait(long) |
Object |
wait(long, int) |
Object |
BufferedInputStream, CheckedInputStream, DataInputStream, FilterInputStream, InflaterInputStream, InputStream, IOException, LineNumberInputStream, PushbackInputStream