public class IoFileReader {
public static void main(String[] args) {
try {
FileReader fr = new FileReader("F://iodemo.txt");
char[] frc = new char[1024];
int len = 0;
while ((len=fr.read(frc)) != -1){
System.out.println(new String(frc));
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
IO字符流--------FileReader
最新推荐文章于 2024-04-17 19:06:37 发布