Java core programming-IO stream Overview (-), javaio

Source: Internet
Author: User

Java core programming-IO stream Overview (-), javaio

1. Four most critical parent classes of java io streams

~ InputStream (input byte stream)

~ OutputStream (output byte stream)

~ Reader (input stream)

~ Writer (output streams)

All the above four classes are public abstract class classes.

InputStream and OutputStream are transmitted in byte (byte. Reader and Writer data are transmitted in the unit of character "character. In java io packages, one class is named in "xxxStream" format, and the other class is named in "xxxReader" or "xxxWriter" format.

2. io stream classification

(From Network)

2.1 there are three types of implementation classes:

~ Category 1: Data Source

~ Category 2: Data Stream concatenation

~ Category 3: Data Stream Filtering

The data source class is the starting class for creating various streams, and the second and third classes are the packaging of various types of instances. The ITALIC part is an abstract class, and the bold part is a common class.

2.2 stream input source types can be classified into two categories:

~ The first class: array, String, File, and so on, the original struct.

~ The second type: a stream of the same type is used as a link stream, called a link stream.

The stream will be explained based on the above two categories.

3. Stream Operation Principle

The so-called stream is the orderly arrangement of data, and the stream can come out from a source to a destination.

The input stream and output stream can be divided into different stream directions. The program reads data from the input stream and outputs data from the output stream.

Depending on the Data Type of the stream, it can be divided into byte streams and batch streams. Byte streams can be converted to bytes streams.

The input stream and output stream can be encapsulated by various filtering streams to form a stream chain, so as to have more functions.

 

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.