I would put an end to the finally block to ensure that it is properly cleared in the event of an exception.
public void tryToDoWhatever() throws Exception { DataInputStream in = null; try { in = new DataInputStream( new BufferedInputStream(new FileInputStream(file))); } finally { if (in != null) in.close(); } }
willcodejavaforfood
source share