title: Why is it good to close() an inputstream?
body: <p>Why is it necessary to <code>close()</code> <code>java.io.InputStream</code> or its subclasses?</p>
  <p>Now with <code>java.io.OutputStream</code>, say <code>FileOutputStream</code>, after writing to a file, if we don't <code>close()</code> the output stream, the data that we intended to write in the file remains in the buffer and is not written to the file.</p>
  <p>So it becomes necessary to <code>close()</code> an <code>OutputStream</code>. But i never had any bitter experiences after <b>not closing</b> an <code>InputStream</code>.</p>
  <p>But still all articles on the internet and books say that it is always good to close any Stream may it be an <code>InputStream</code> or an <code>OutputStream</code>.</p>
  <p>So my question is that why does it become necessary to <code>close()</code> an <code>InputStream</code>? People say that you may face a memory leak of you don't <code>close()</code> it. So what kind of a memory leak is that?</p>