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);
}

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 ) ; }
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 .
