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

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