title: DataInputStream who close stream if IOException
body: <p>In all examples everybody can find code like this:</p>
  
  <pre><code>DataInputStream inputStream = null;
  try {
      inputStream = new DataInputStream( new FileInputStream("file.data"));
      int i = inputStream.readInt();
      inputStream.close();
  } catch (FileNotFoundException e) { 
      //print message File not found
  } catch (IOException e) { e.printStackTrace() }
  </code></pre>
  
  <p>When this code met <code>FileNotFound</code> exception, <code>inputStream</code> was not open, so it doesn't need to be closed.</p>
  
  <p>But why when <code>IOException</code> mets in that catch block I don't see <code>inputStream.close()</code>. This operation did's automatically when input data exception throws? Because if programm has problem with input this means that stream already open. </p>