FileOutputStream fileOut=new FileOutputStream("m_"+filename);
byte[] outBuf=str.getBytes();
int len=str.length();
fileOut.write(outBuf,0,len);
else
fileOut.write(outBuf,0,len);
///////////////////////////////////////////////////////////////////////
发现输出到文件中的字符比str 少了几个,什么原因啊
byte[] outBuf=str.getBytes();
int len=str.length();
fileOut.write(outBuf,0,len);
else
fileOut.write(outBuf,0,len);
///////////////////////////////////////////////////////////////////////
发现输出到文件中的字符比str 少了几个,什么原因啊
如果你把str转换为byte,汉字就占两个字节,字母就占一个字节