62,616
社区成员
发帖
与我相关
我的任务
分享
/**
* t.txt的记录如下:
* Chinses
* 中文
*
* */
public static void main(String[] args) throws IOException{
File f = new File("C:/t.txt");
int b;
InputStream in = new FileInputStream(f);
while((b = in.read()) != -1){
System.out.print((char)b); // 中文 必然会出现???
}
System.out.println();
Reader r = new FileReader(f);
while((b = r.read()) != -1){
System.out.print((char)b); // 这里却相安无事!
}
}