void expandHeap(int need){
  this.bstr=null;
  allocate();
  if (this.heapSize + need > this.heap.length) {
    int newlen=(this.heapSize + need) * 2;
    if (newlen < MINIMUM_HEAP_SIZE) {
      newlen=MINIMUM_HEAP_SIZE;
    }
    byte[] newHeap=new byte[newlen];
    System.arraycopy(this.heap,0,newHeap,0,this.heapSize);
    this.heap=newHeap;
  }
}

void expandHeap ( int need ) { this . bstr = null ; allocate ( ) ; if ( this . heapSize + need > this . heap . length ) { int newlen = ( this . heapSize + need ) * 2 ; if ( newlen < MINIMUM_HEAP_SIZE ) { newlen = MINIMUM_HEAP_SIZE ; } byte [ ] newHeap = new byte [ newlen ] ; System . arraycopy ( this . heap , 0 , newHeap , 0 , this . heapSize ) ; this . heap = newHeap ; } }
check if the heap can accommodate a given requirement . if not expand the heap .
