public void append(char c[],int off,int len){
  int restLength=buffer.length - pos;
  if (len < restLength) {
    System.arraycopy(c,off,buffer,pos,len);
    pos+=len;
  }
 else {
    System.arraycopy(c,off,buffer,pos,restLength);
    curr.next=new Entity(buffer);
    curr=curr.next;
    length+=buffer.length;
    buffer=new char[(buffer.length > len - restLength) ? buffer.length : len - restLength];
    System.arraycopy(c,off + restLength,buffer,0,len - restLength);
    pos=len - restLength;
  }
}

public void append ( char c [ ] , int off , int len ) { int restLength = buffer . length - pos ; if ( len < restLength ) { System . arraycopy ( c , off , buffer , pos , len ) ; pos += len ; } else { System . arraycopy ( c , off , buffer , pos , restLength ) ; curr . next = new Entity ( buffer ) ; curr = curr . next ; length += buffer . length ; buffer = new char [ ( buffer . length > len - restLength ) ? buffer . length : len - restLength ] ; System . arraycopy ( c , off + restLength , buffer , 0 , len - restLength ) ; pos = len - restLength ; } }
method to append a part of a char array
