package JavaSE.Lesson18;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
public class ReaderDemo {
public static void main(String[] args) {
String str = "e:\\Demo02.txt";
FileReader fr= null;
char[] buf = new char[8];
int dataLen;
try {
fr = new FileReader(str);
//这个返回的是数值的值
while ((dataLen=fr.read(buf))!=-1){
System.out.print(new String(buf,0,dataLen));
}
} catch (IOException e) {
e.printStackTrace();
} finally {
if (fr!=null){
try {
fr.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}