title: Should I use method close or closeQuietly to close an output stream?
body: <p>When we need close an output stream, we have two choices. </p>
  
  <ol>
  <li><p>closeQuietly means close a stream with no exception throwing up.</p>
  
  <pre><code>try {
      close(out)
  } catch(IOException e) {
  }
  </code></pre></li>
  <li><p>close</p>
  
  <pre><code>try {
      close(out)
  } catch(IOException e) {
      throw anException;
  }
  </code></pre></li>
  </ol>
  
  <p>as known, output stream will write a/several chars into the end of file when closing, if these writing goes wrong, the file also can't be open correctly such as ZipoutputStream.</p>
  
  <p>if I use the first one, I will get some risk of fail closing.
  if I use the second one, it will let my code unfriendly.</p>
  
  <p>Could someone give me some advices?</p>
  
  <p>So sorry for describing the issue unclearly.</p>
  
  <p>I meant that how to get an IO operation safely. if a resource's release gets failed, it would let caller know.</p>
  
  <p>Thanks for all your answer. And especially thank @Don Roby for giving me a link which contains the best answer answered by @Fabian Barney</p>