public static void safelyClose ( OutputStream stream ) { if ( stream != null ) { try { stream . close ( ) ; } catch ( IOException e ) { logger . warn ( "error closing internal output stream, this may lead to a stream leak" , e ) ; } } }
Tries to close the given stream ; if any exception is thrown in the process it suppresses it .