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