123456789101112131415161718192021222324 |
- package J20250725;
- import java.io.FileInputStream;
- import java.io.FileNotFoundException;
- import java.io.IOException;
- /**
- * @author WanJl
- * @version 1.0
- * @title Demo04_FileInputStream
- * @description
- * @create 2025/7/25
- */
- public class Demo04_FileInputStream {
- public static void main(String[] args) throws IOException {
- //创建文件字节输入流对象
- FileInputStream fis=new FileInputStream("D:/2025年7月25日.txt");
- int by; //每一次要读的字节
- while((by=fis.read())!=-1){
- System.out.print((char)by);
- }
- }
- }
|