当前位置: 代码迷 >> J2SE >> RandomAccessFile用 writeUTF() 写文件的时候为什么第一个字符会是乱码?该怎么解决
  详细解决方案

RandomAccessFile用 writeUTF() 写文件的时候为什么第一个字符会是乱码?该怎么解决

热度:72   发布时间:2016-04-24 13:51:06.0
RandomAccessFile用 writeUTF() 写文件的时候为什么第一个字符会是乱码?
RandomAccessFile用     writeUTF()   写文件的时候为什么第一个字符会是乱码,请高手指点

------解决方案--------------------
First, two bytes are written to the file, starting at the current file pointer, as if by the writeShort method giving the number of bytes to follow. This value is the number of bytes actually written out, not the length of the string. Following the length, each character of the string is output, in sequence, using the UTF-8 encoding for each character.