public static String fileReader(File file) throws IOException {
String contants;
FileReader fr =new FileReader(file);
BufferedReader br =new BufferedReader(fr);
//
contants=br.readLine();
while (br.ready()){
contants=contants+br.readLine();
}
fr.close();
br.close();
return contants;
}
原文:https://www.cnblogs.com/yuxiannana/p/15303107.html