IO流——各种流整理
最简单的,不加任何修饰的字节输入流 1 /* 2 * 最简单的,不加任何修饰的字节输入流 3 */ 4 import java.io.FileInputStream; 5 6 public class Demo_01 { 7 public static void main(String[] args) throws Exception { 8 FileInputStream file=new FileInputStream("D:\\myjavacode\\IO\\src\\abc.txt"); 9 int temp =-1; 10 while((temp=file.read())!=-1) { 11 System.out.println((char)temp); 12 } 13 file.close(); 14 } 15 } 用数组做缓冲容器 1 import java.io.FileInputStream; 2 3 /* 4 * 用数组做缓冲容器 5 */ 6 public class Demo_02 { 7 public static void main(String[] args) throws Exception { 8 FileInputStream file=new FileInputStream("D:\\myjavacode\\IO\\src\\abc.txt")