62,614
社区成员
发帖
与我相关
我的任务
分享
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
public class Fis {
public static void main(String[] args) {
int b = 0;
FileInputStream in = null;
try {
in = new FileInputStream("c:\\Fis.java");
} catch (FileNotFoundException e) {
System.out.println("file not found!");
e.printStackTrace();
System.exit(-1);
}
try {
int num = 0;
while ((b = in.read()) != -1) {
System.out.println((char) b);
num++;
}
// in.close();
} catch (IOException e) {
System.out.println("file read error!");
e.printStackTrace();
System.exit(-1);
}
}
}