Stream classification commonly used in Java IO stream architecture

Source: Internet
Author: User

Stream classification commonly used in Java input/output stream systems (table content from http://www.cnblogs.com/moonpool/p/5488463.html)

Note: Abstract classes are underlined in the following table, and objects cannot be created. The bold part is the node stream, and the other is the usual processing stream.

Stream classification Use classification BYTE input stream BYTE output stream Character input stream Character output stream
Abstract base class InputStream

OutputStream

Reader Writer
Node stream accessing files FileInputStream Fileoutstream FileReader FileWriter
accessing values Bytearrayinputstream Bytearrayoutstream CharArrayReader Chararraywriter
Access pipeline PipedInputStream Pipedoutstream Pipedreader PipedWriter
accessing strings StringReader StringWriter
Process Flow Buffered streams Bufferedinputstream Bufferedoutputstream BufferedReader BufferedWriter
Convert stream InputStreamReader OutputStreamWriter
Object Flow ObjectInputStream ObjectOutputStream
Abstract base class (filter) FilterInputStream Filteroutputstream FilterReader Filterwriter
Print Flow PrintStream PrintWriter
Pushing back the input stream Pushbackinputstream Pushbackreader
Special flow DataInputStream DataOutputStream

——————————————————————————————————————————————————————————————————

Summarize:

1.Java io is a decorative mode, that is, the process flow to wrap the flow of nodes to achieve code commonality.

2. Process flow and node flow differentiation method, node flow in the new need a data source (file, network) as a parameter, and the processing flow requires a node stream as a parameter.

3. The role of the processing stream is to improve the code commonality, write code convenience, improve performance.

4. node Flow is the implementation class corresponding to the abstract base class, both of which implement the basic reading and writing methods of the abstract base class. where the Read () method returns 1, the representation has been read to the end of the data source.

Stream classification commonly used in Java IO stream architecture

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.