public static void safeCloseStream(InputStream in){
  if (in != null) {
    try {
      in.close();
    }
 catch (    Exception e) {
      log.error(e.getMessage(),e);
    }
  }
}

public static void safeCloseStream ( InputStream in ) { if ( in != null ) { try { in . close ( ) ; } catch ( Exception e ) { log . error ( e . getMessage ( ) , e ) ; } } }
close streams without pain
