Character stream of Java's IO stream

The emergence of character stream solves the inconvenience of byte stream operation in Chinese, character stream = byte stream + encoding table.

When copying a text file with a byte stream, there is Chinese in the text but it is okay. The reason is that the underlying operation automatically splices bytes into Chinese. How does it recognize Chinese?
The reason is that when Chinese characters are stored, no matter which encoding method is selected, the first byte is a negative number. (2 bytes for GBK format station and 3 bytes for UTF-8 station)

Guess you like

Origin blog.csdn.net/Wangdiankun/article/details/105822196