title: Safe use of HttpURLConnection
body: <p>When using HttpURLConnection does the InputStream need to be closed if we do not 'get' and use it?</p>
  
  <p>i.e. is this safe?</p>
  
  <pre><code>HttpURLConnection conn = (HttpURLConnection) uri.getURI().toURL().openConnection();
  conn.connect();
  // check for content type I don't care about
  if (conn.getContentType.equals("image/gif") return; 
  // get stream and read from it
  InputStream is = conn.getInputStream();
  try {
      // read from is
  } finally {
      is.close();
  }
  </code></pre>
  
  <p>Secondly, is it safe to close an InputStream <strong><em>before all of it's content has been fully read</em></strong>?</p>
  
  <p>Is there a risk of leaving the underlying socket in ESTABLISHED or even CLOSE_WAIT state?</p>