FilterInputStream Introduction
The role of FilterInputStream is to "encapsulate other input streams and provide them with additional functionality". Its commonly used subclasses are Bufferedinputstream and DataInputStream.
The function of Bufferedinputstream is to provide buffering function for the input stream and mark () and Reset ().
DataInputStream is used to decorate other input streams, which "allows applications to read basic Java data types from the underlying input stream in a machine-independent manner." Applications can use DataOutputStream (data output streams) to write data that is read by the DataInputStream (data input stream).
FilterInputStream source (based on jdk1.7.40)
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/Java/
Package java.io;
public class FilterInputStream extends InputStream {protected volatile, inputstream in;
Protected FilterInputStream (InputStream in) {this.in = in;
public int read () throws IOException {return in.read ();
public int read (byte b[]) throws IOException {return read (b, 0, b.length);
public int read (byte b[], int out, int len) throws IOException {return In.read (b, off, Len);
Public long Skip (long N) throws IOException {return In.skip (n);
public int available () throws IOException {return in.available ();
public void Close () throws IOException {in.close ();
Public synchronized void mark (int readlimit) {In.mark (readlimit);
Public synchronized void Reset () throws IOException {In.reset (); public boolean marksupported () {return in.maRksupported (); }
}
Source: http://www.cnblogs.com/skywang12345/p/io_10.html