src/main/java/org/jboss/util/stream/Streams.java
/**
    * Attempt to close an <tt>InputStream</tt> or <tt>OutputStream</tt>.
    *
    * @param stream  Stream 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.
    *
    * @throws IllegalArgumentException    Stream is not an <tt>InputStream</tt>
    *                                     or <tt>OuputStream</tt>.
    */
Attempt to close an InputStream or OutputStream.
@param stream  Stream 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 InputStream or OutputStream . @param stream Stream 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 Object stream) {
      boolean success = false;
      if (stream instanceof InputStream) {
         success = close((InputStream)stream);
      }
      else if (stream instanceof OutputStream) {
         success = close((OutputStream)stream);
      }
      else {
         throw new IllegalArgumentException
            ("stream is not an InputStream or OutputStream");
      }
      return success;
   }
public static boolean close ( final Object stream ) { boolean success = false ; if ( stream instanceof InputStream ) { success = close ( ( InputStream ) stream ) ; } else if ( stream instanceof OutputStream ) { success = close ( ( OutputStream ) stream ) ; } else { throw new IllegalArgumentException ( "stream is not an InputStream or OutputStream" ) ; } return success ; }
Attempt to close an <tt>InputStream</tt> or <tt>OutputStream</tt>.
Attempt to close an <tt > InputStream< / tt > or <tt > OutputStream< / tt > .