title: how to declare and close InputSteam?
body: <p>which of the following is the preferred way to close and declare the inputStream.</p>
  
  <pre><code>InputStream is = null; 
  String md5;
  try{
      is = new FileInputStream(FILE.getAbsoluteFile());
      md5 = UTILS.getMD5Info(is);
  } finally{
      if(is != null) 
          is.close();
  }
  </code></pre>
  
  <p>or</p>
  
  <pre><code>InputStream is = new FileInputStream(FILE.getAbsoluteFile()); 
  String md5;
  try{
      md5 = UTILS.getMD5Info(is);
  } finally{
      is.close();
  }
  </code></pre>
  
  <p>I don't see much difference between the two, but the 2nd way looks better as its a bit short. Is there any use of initializing the input stream inside a try block if we are not going to catch the exception and are just interested in garbage collecting the inputStream ?</p>