用字节流读取都是问号 用字符流读取就没问题 谁帮我解答一下
BufferedInputStream bi = null;
try {
bi = new BufferedInputStream(new FileInputStream("a.txt"));
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
System.out.println("文件不存在");
e.printStackTrace();
}
BufferedOutputStream bo = null;
try {
bo = new BufferedOutputStream(new FileOutputStream("c.txt"));
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
System.out.println("文件不存在");
e.printStackTrace();
}
byte[] b = new byte[1024];
int num = 0;
while((num = (bi.read()))!=-1){
System.out.println((char)bi.read(b));
}
|
|