import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
public class Demo10 {
public static void main(String[] args) throws Exception {
File file = new File("文件路径/文件名");
FileInputStream fi = new FileInputStream(file);
BufferedReader bufr = new BufferedReader(new InputStreamReader(fi,"utf-8"));
String line=null;
while((line=bufr.readLine())!=null){
System.out.println(line);
}
}
}
//当然是可以的,我这个程序是读一行输出到控制台上,直到全部读完,注意编码格式,文件对象你改改就行了