Java I/O Learning summary (i)

Source: Internet
Author: User

Let's take a look at a picture of Java I/O (Don't Panic)

This picture must have seen many times, very detailed Java I/O related content listed out, for the moment not to be frightened, we learn while summing up, finally back to look at this picture, there will be a different feeling.

Java's core library, Java.io, provides a comprehensive IO interface. Include: file reading and writing, standard equipment output, etc. Io in Java is input and output on a stream basis, and all data is serialized to the output stream or read in from the input stream.

Flow

Flow is a very image concept, when the program needs to read the data, it will open a stream to the data source, the data source can be a file, memory, or network connection. Similarly, when a program needs to write data, it opens a stream to the destination. At this point you can imagine the data as "flowing" in it.

The concept of the above flow from the Baidu Encyclopedia (Http://baike.baidu.com/item/java.io), bloggers feel that the concept of interpretation has been quite clear, and then popular, flow is a "pipeline", when your program reads or stores data, The data flows in this pipeline.

The classification of the Java stream is divided by the direction of flow (memory and the orientation between the disks):

Input stream: The stream from which the program can read data (from hard disk to memory)

Output stream: The stream to which the program can write data (from memory to hard disk)

By unit of data transfer:

BYTE stream: Streams that transmit data in bytes

Character stream: Streams that transmit data in characters

By Function: node flow: Stream filtering flow for direct manipulation of target devices: It is a link and encapsulation of an existing stream, which provides powerful and flexible reading and writing functions by processing the data. Java I/O common classes

All stream classes provided by the JDK are located in the Java.io package, each inheriting from the following four abstract stream classes.

InputStream: Streams that inherit from InputStream are used to enter data into the program, and the Data units are bytes (8-bit).  OutputStream: Streams that inherit from OutputStream are programs that output data outward, and the data units are bytes (8-bit).  Reader: Streams that inherit from reader are used to enter data into the program, and the data units are characters (16 bits). Writer: streams that inherit from writer are programs that output data outward, and the data units are characters (16 bits).

Java I/O Learning summary (i)

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.