code: public static void copy(Reader reader, Writer writer, boolean closeStreams) throws IOException {
  		char[] buf = new char[BUFFER_SIZE];
  		int num = 0;
  
  		try {
  			while ((num = reader.read(buf, 0, buf.length)) != -1) {
  				writer.write(buf, 0, num);
  			}
  		} finally {
  			if (closeStreams) {
  				close(reader);
  				close(writer);
  			}
  		}
  	}
docs: Writes all the contents of a Reader to a Writer.
  
  @param reader
  the reader to read from
  @param writer
  the writer to write to
  @param closeStreams
  the flag indicating if the stream must be close at the end,
  even if an exception occurs
  @throws java.io.IOException
  if an IOExcption occurs