private int evictToRecoverBytes(int bytesToRecover){
  int entriesToEvict=0;
  if (bytesToRecover > 0) {
    for (int j=dynamicTable.length - 1; j >= nextHeaderIndex && bytesToRecover > 0; j--) {
      bytesToRecover-=dynamicTable[j].hpackSize;
      dynamicTableByteCount-=dynamicTable[j].hpackSize;
      headerCount--;
      entriesToEvict++;
    }
    System.arraycopy(dynamicTable,nextHeaderIndex + 1,dynamicTable,nextHeaderIndex + 1 + entriesToEvict,headerCount);
    nextHeaderIndex+=entriesToEvict;
  }
  return entriesToEvict;
}

private int evictToRecoverBytes ( int bytesToRecover ) { int entriesToEvict = 0 ; if ( bytesToRecover > 0 ) { for ( int j = dynamicTable . length - 1 ; j >= nextHeaderIndex && bytesToRecover > 0 ; j -- ) { bytesToRecover -= dynamicTable [ j ] . hpackSize ; dynamicTableByteCount -= dynamicTable [ j ] . hpackSize ; headerCount -- ; entriesToEvict ++ ; } System . arraycopy ( dynamicTable , nextHeaderIndex + 1 , dynamicTable , nextHeaderIndex + 1 + entriesToEvict , headerCount ) ; nextHeaderIndex += entriesToEvict ; } return entriesToEvict ; }
returns the count of entries evicted .
