package JavaSE.Lesson18;
import java.io.FileReader;
import java.io.IOException;
public class ReaderDemo02 {
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())!=-1){
System.out.print((char)dataLen);
}
} catch (IOException e) {
e.printStackTrace();
} finally {
if (fr!=null){
try {
fr.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}