Java IO Learning (ix) FilterInputStream

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.