public void shrink(){
  if (c.length == length) {
    return;
  }
  char[] newc=new char[length];
  System.arraycopy(c,0,newc,0,length);
  c=newc;
}

public void shrink ( ) { if ( c . length == length ) { return ; } char [ ] newc = new char [ length ] ; System . arraycopy ( c , 0 , newc , 0 , length ) ; c = newc ; }
shrinks the capacity of the buffer to the current length if necessary . this method involves copying the data once !
