import java.io.FileInputStream;标签:code,java,字节,读数据,io,fileInputStream,FileInputStream,输入 From: https://blog.51cto.com/u_13137233/5940238
import java.io.FileNotFoundException;
import java.io.IOException;
public class Teest3 {
public static void main(String[] args) throws IOException {
// 目标,a.txt,读它
FileInputStream fileInputStream = new FileInputStream("a.txt");
// 一个字节一个字节的来读
int code = fileInputStream.read();
// 判断有没有读到数据
while (code != -1) {
// 把code的值输出
System.out.println(code);
// 光标右移
code = fileInputStream.read();
}
System.out.println("game over");
}
}