private StringBuilder readFileContents(File file) {
StringBuilder builder = new StringBuilder() ;
try {
assert file.exists() ;
BufferedReader reader = new BufferedReader( new FileReader(file)) ;
while( reader.readLine() != null) {
builder.append ( reader.readLine()) ;
}
}catch(IOException e){
e.printStackTrace() ;
}
return builder ;
}
No comments:
Post a Comment