Skip to content

Instantly share code, notes, and snippets.

@masud-technope
Created October 22, 2015 03:38
Show Gist options
  • Save masud-technope/bb1d4082c16e6604d8c5 to your computer and use it in GitHub Desktop.
Save masud-technope/bb1d4082c16e6604d8c5 to your computer and use it in GitHub Desktop.
try {
File myFile = new File(fileName);
if(!myFile.exists()){
System.err.println("File does not exist: "+ fileName);
}
BufferedReader reader = new BufferedReader(new FileReader(myFile));
while (reader.ready()) {
String line = reader.readLine();
content += line + "\n";
}
reader.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment