fileinputstream1.java
来自「这是java io流的一个通信小程序」· Java 代码 · 共 22 行
JAVA
22 行
import java.io.*;
public class FileInputStream1 {
public static void main(String[] args) {
FileInputStream fin = null;
try {
fin = new FileInputStream("d:\\share\\jproject\\io\\a.txt");
}catch(FileNotFoundException e) {
System.out.println("the file is not found now!!");
}
try {
int b = 0;
while((b=fin.read()) != -1) {
System.out.print((char)b);
}
}catch(IOException e) {
System.out.println("the file read is error!!");
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?