public static int copyAndCloseOutput(Reader input,Writer output) throws IOException {
  try {
    return copy(input,output);
  }
  finally {
    output.close();
  }
}

public static int copyAndCloseOutput ( Reader input , Writer output ) throws IOException { try { return copy ( input , output ) ; } finally { output . close ( ) ; } }
copy input to output and close the output stream before returning
