public static void closeSilently(Writer writer){
  if (writer != null) {
    try {
      writer.flush();
      writer.close();
    }
 catch (    Exception e) {
    }
  }
}

public static void closeSilently ( Writer writer ) { if ( writer != null ) { try { writer . flush ( ) ; writer . close ( ) ; } catch ( Exception e ) { } } }
close a writer without throwing an exception .
