code: public static void copy(Reader r, Writer w, boolean close) throws IOException {
          char[] buf = new char[DEFAULT_BUFFER_SIZE];
          int len;
          try {
              while ((len = r.read(buf)) != -1) {
                  w.write(buf, 0, len);
              }
          } finally {
              if (close) {
                  closeQuietly(r);
                  closeQuietly(w);
              }
          }
      }
docs: Copies all text from the given reader to the given writer.
  
  @param r
  the reader.
  @param w
  the writer.
  @param close
  <code>true</code> if both reader and writer are closed afterwards, <code>false</code> otherwise.
  
  @throws IOException
  if an I/O error occurs.