字节输入流类

public static void main(String [] args) throws Exception{

//创建文件输入流对象
  File f=new File("src/main2dishizhang/java.txt");
  InputStream  is=new FileInputStream(f);

//循环读数据
  int b;
  while((b=is.read())!=-1){
   System.out.println((char)b);
  }
 }

原文地址:https://www.cnblogs.com/xuling123/p/6822059.html