|
|||||||||
| Home >> All >> java >> [ io overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.io
Class FilterInputStream

java.lang.Objectjava.io.InputStream
java.io.FilterInputStream
- All Implemented Interfaces:
- Closeable
- Direct Known Subclasses:
- BufferedInputStream, DataInputStream, LineNumberInputStream, PushbackInputStream
- public class FilterInputStream
- extends InputStream
This is the common superclass of all standard classes that filter
input. It acts as a layer on top of an underlying InputStream
and simply redirects calls made to it to the subordinate InputStream
instead. Subclasses of this class perform additional filtering
functions in addition to simply redirecting the call.
This class is not abstract. However, since it only redirects calls
to a subordinate InputStream without adding any functionality
on top of it, this class should not be used directly. Instead, various
subclasses of this class should be used. This is enforced with a
protected constructor. Do not try to hack around it.
When creating a subclass of FilterInputStream, override the
appropriate methods to implement the desired filtering. However, note
that the read(byte[]) method does not need to be overridden
as this class redirects calls to that method to
read(byte[], int, int) instead of to the subordinate
InputStream read(byte[]) method.
| Field Summary | |
protected InputStream |
in
This is the subordinate InputStream to which method calls
are redirected |
| Constructor Summary | |
protected |
FilterInputStream(InputStream in)
Create a FilterInputStream with the specified subordinate
InputStream. |
| Method Summary | |
int |
available()
Calls the in.available() method. |
void |
close()
This method closes the input stream by closing the input stream that this object is filtering. |
void |
mark(int readlimit)
Calls the in.mark(int) method. |
boolean |
markSupported()
Calls the in.markSupported() method. |
int |
read()
Calls the in.read() method |
int |
read(byte[] buf)
Calls the read(byte[], int, int) overloaded method. |
int |
read(byte[] buf,
int offset,
int len)
Calls the in.read(byte[], int, int) method. |
void |
reset()
Calls the in.reset() method. |
long |
skip(long numBytes)
Calls the in.skip(long) method |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
in
protected InputStream in
- This is the subordinate
InputStreamto which method calls are redirected
| Constructor Detail |
FilterInputStream
protected FilterInputStream(InputStream in)
- Create a
FilterInputStreamwith the specified subordinateInputStream.
| Method Detail |
mark
public void mark(int readlimit)
- Calls the
in.mark(int)method.- Overrides:
markin classInputStream
markSupported
public boolean markSupported()
- Calls the
in.markSupported()method.- Overrides:
markSupportedin classInputStream
reset
public void reset()
throws IOException
- Calls the
in.reset()method.- Overrides:
resetin classInputStream
available
public int available()
throws IOException
- Calls the
in.available()method.- Overrides:
availablein classInputStream
skip
public long skip(long numBytes)
throws IOException
- Calls the
in.skip(long)method- Overrides:
skipin classInputStream
read
public int read()
throws IOException
- Calls the
in.read()method- Specified by:
readin classInputStream
read
public int read(byte[] buf)
throws IOException
- Calls the
read(byte[], int, int)overloaded method. Note that this method does not redirect its call directly to a corresponding method inin. This allows subclasses to override only the three argument version ofread.- Overrides:
readin classInputStream
read
public int read(byte[] buf,
int offset,
int len)
throws IOException
- Calls the
in.read(byte[], int, int)method.- Overrides:
readin classInputStream
close
public void close()
throws IOException
- This method closes the input stream by closing the input stream that
this object is filtering. Future attempts to access this stream may
throw an exception.
- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream
|
|||||||||
| Home >> All >> java >> [ io overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC