public char[] toCharArray(){
  Entity e=root;
  char[] chrs=new char[size()];
  int off=0;
  while (e.next != null) {
    e=e.next;
    System.arraycopy(e.data,0,chrs,off,e.data.length);
    off+=e.data.length;
  }
  System.arraycopy(buffer,0,chrs,off,pos);
  return chrs;
}

public char [ ] toCharArray ( ) { Entity e = root ; char [ ] chrs = new char [ size ( ) ] ; int off = 0 ; while ( e . next != null ) { e = e . next ; System . arraycopy ( e . data , 0 , chrs , off , e . data . length ) ; off += e . data . length ; } System . arraycopy ( buffer , 0 , chrs , off , pos ) ; return chrs ; }
return content of the char buffer as char array
