📄 eightfileread.java
字号:
import java.io.*;
//文件读取
public class EightFileRead {
FileInputStream fis = null;
public EightFileRead(String filename) {
try {
fis = new FileInputStream(filename);
} catch (FileNotFoundException e) {
System.out.println("File read error!");
System.exit(0);
}
}
public int readFileNum() {
int b = 0;
try {
while (b > 58 || b < 48) {
b = fis.read();
}
} catch (IOException e) {
System.out.println("Data input error!");
System.exit(0);
}
b = b - 48;
return b;
}
public void close() {
try {
fis.close();
} catch (IOException e) {
System.out.println("File close error!");
System.exit(0);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -