/**
* 读取文件成字符串
*/
public static String file2str(String path) {
StringBuilder sb = new StringBuilder();
try {
BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(path)));
String str = new String();
while ((str = in.readLine()) != null) {
sb.append(str);
}
in.close();
} catch (Exception e) {
e.printStackTrace();
}
return sb.toString();
}
读取文件成字符串
最新推荐文章于 2023-04-04 11:25:30 发布