我用的是RandomAccessFile fileout = new RandomAccessFile("filename","rw");fileout.writeBytes(file);解决了,只要手工指定字符集就行了