Skip to content

Instantly share code, notes, and snippets.

@ksakae1216
Created June 11, 2017 13:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ksakae1216/b2d8812153824d53b8599a0d03cdcd2c to your computer and use it in GitHub Desktop.
Save ksakae1216/b2d8812153824d53b8599a0d03cdcd2c to your computer and use it in GitHub Desktop.
// 旧来のファイル読み込み
private void oldFileRead(String file) {
FileInputStream fi = null;
InputStreamReader in = null;
BufferedReader br = null;
try {
fi = new FileInputStream(file);
in = new InputStreamReader(fi);
br = new BufferedReader(in);
// ファイル読み込み
String line;
while( (line = br.readLine()) != null) {
System.out.println(line);
}
} catch(Exception e) {
} finally {
try {
// クローズ処理
br.close();
in.close();
fi.close();
} catch(Exception fe) {
// クローズ失敗
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment