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.