java byte input stream output stream

In ASCII code, one English letter occupies one byte of space, and one Chinese character occupies two bytes of space; 2. In UTF-8 encoding, one English character is equal to one byte, and one Chinese (including traditional) is equal to three byte.

fileoutstream

Because they are all byte input streams and output streams, both writing and reading are ASCII code values, but when the real file is clicked, characters are displayed

Every time read() is executed, the pointer points to the next one;

Note that the read() method reads only one byte and returns the code value of this byte, while read(byte[] b) puts all the bytes read in b

Turn off the write first and then turn off the read. If you turn off the read first and the write operation is in progress, it will be affected.

Guess you like

Origin blog.csdn.net/m0_37839403/article/details/113993575