public static void silentCloseOutputStream(OutputStream os){
  try {
    if (os != null) {
      os.close();
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

public static void silentCloseOutputStream ( OutputStream os ) { try { if ( os != null ) { os . close ( ) ; } } catch ( IOException e ) { e . printStackTrace ( ) ; } }
a utility function to close an output stream without raising an exception .
