标签:io os java sp 文件 on ad bs line
public String readFromFile(File src) {
try {
BufferedReader bufferedReader = new BufferedReader(new FileReader(
src));
StringBuilder stringBuilder = new StringBuilder();
String content;
while((content = bufferedReader.readLine() )!=null){
stringBuilder.append(content);
}
return stringBuilder.toString();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return null;
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return null;
}
}
标签:io os java sp 文件 on ad bs line
原文地址:http://www.cnblogs.com/rxingyue/p/4039165.html