首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2SE开发 >

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

2011-12-27 
RandomAccessFile用writeUTF() 写文件的时候为什么第一个字符会是乱码?RandomAccessFile用writeUTF()写文

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.

热点排行