62,612
社区成员
发帖
与我相关
我的任务
分享
package lab11;
import java.io.*;
public class Lab1102 {
public static void main(String[] args) {
try {
BufferedInputStream bis = new BufferedInputStream(new FileInputStream("letter.txt"));
int i = 0;
while ((i = bis.read()) != -1) {
System.out.print((char) i);
}
// char c = 0; //循环无法结束
// while ( (c = (char)bis.read() ) != -1 ) {
// System.out.print(c);
// }
bis.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e1) {
}
}
}