src/main/java/org/jboss/util/stream/Streams.java
/**
    * Attempt to close an <tt>OutputStream</tt>.
    *
    * @param stream  <tt>OutputStream</tt> to attempt to close.
    * @return        <tt>True</tt> if stream was closed (or stream was null),
    *                or <tt>false</tt> if an exception was thrown.
    */
Attempt to close an OutputStream.
@param stream  OutputStream to attempt to close.
@return        True if stream was closed (or stream was null),
or false if an exception was thrown.
Attempt to close an OutputStream . @param stream OutputStream to attempt to close . @return True if stream was closed ( or stream was null ) or false if an exception was thrown .
public static boolean close(final OutputStream stream) {
      if (stream == null) {
         return true;
      }
      boolean success = true;
      try {
         stream.close();
      }
      catch (IOException e) {
         success = false;
      }
      return success;
   }
public static boolean close ( final OutputStream stream ) { if ( stream == null ) { return true ; } boolean success = true ; try { stream . close ( ) ; } catch ( IOException e ) { success = false ; } return success ; }
Attempt to close an <tt>OutputStream</tt>.
Attempt to close an <tt > OutputStream< / tt > .
// do not attempt to close null stream, but return sucess