code: public static void copy(Reader in, Writer out) throws IOException {
      char[] buf = new char[1024];
      while (true) {
        int count = in.read(buf);
        if (count < 0) {
          break;
        }
        out.write(buf, 0, count);
      }
      out.flush();
    }
docs: Copies the content of a reader to a writer.
  @param in the reader to read
  @param out the writer to write
  @throws java.io.IOException if an I/O error occurs