JAVA-IO detailed

(1) Introduction to byte stream, character stream recognition and application scenarios

The difference between byte stream and character stream is very simple, and their usage is almost the same. The difference is that

1: The data unit operated by byte stream and character stream is different: the minimum unit data of byte stream operation is 8-bit bytes, and the minimum data unit of character stream is 16 bytes.

2: When reading and writing, the byte stream is read and written by byte, and the character stream is read and written by character. The byte stream is mainly composed of InputStream and OutputStream as the base class, while the character stream is mainly completed by the Reader and Writer as the base class.

3: Byte stream is suitable for data transmission of all types of files, because the computer byte (Byte) is the smallest unit that represents the meaning of information in the computer. The character stream can only process plain text data, other types of data cannot, but the character stream processing text is more convenient than the byte stream processing text

(2) Detailed IO

https://www.jianshu.com/p/d6951279a947

Guess you like

Origin blog.csdn.net/CUITAO2305532402/article/details/111302622