本帖最后由 周兴中 于 2012-6-26 11:44 编辑
BufferedReader bufr=
new BufferedReader(new InputStreamReader(new FileInputStream("1.bmp"),"UTF-16BE"));//由于InputStreamReader 是字节流通向字符流的桥梁:它使用指定的 charset 读取字节并将其解码为字符。它使用的字符集可以由名称指定或显式给定,或者可以接受平台默认的字符集。而默认的字符集是GBK,图片的字符集是UTF-16BE ,UTF-16LE,所以要想正确编码和解码,需设置字符集为UTF-16BE或UTF-16LE.
BufferedWriter bufw=
new BufferedWriter(new OutputStreamWriter(new FileOutputStream("2.bmp"),"UTF-16BE"));//OutputStreamWriter 同理 |