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);
}
}
时间: 2024-12-06 13:15:43