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); } }本文共 284 字,大约阅读时间需要 1 分钟。
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