code: public void writeOut(Writer writer) throws IOException {
  
  	Entity e = root;
  	while (e.next != null) {
  	    e = e.next;
  	    writer.write(e.data);
  	}
  	writer.write(buffer, 0, pos);
      }
docs: method to writeout content of the char buffer in a writer, this is faster than get char array
  with (toCharArray()) and write this in writer.
  
  @param writer writer to write inside
  @throws IOException