@Override
  public void setCapacity(int record, int capacity) throws IOException {
    markDirty();

    int sizeAndCapacityOfRecordAbsoluteOffset = getOffset(record, SIZE_AND_CAPACITY_OFFSET);
    int currentValue = myStorage.getInt(sizeAndCapacityOfRecordAbsoluteOffset);
    if (currentValue < 0) {
      // update capacity in indirect record
      myStorage.putInt(getOffset(-currentValue, CAPACITY_OFFSET_IN_INDIRECT_RECORD), capacity);
      return;
    }

    // size to fit in normal record [0 .. 0x7FFF]
    if (capacity > 0x7fff || capacity < 0 || forceSplit) {
      // introduce indirect record able to hold larger capacity range
      extendSizeAndCapacityRecord(record, getSize(record), capacity);
      return;
    }
    myStorage.putInt(sizeAndCapacityOfRecordAbsoluteOffset, (currentValue & SIZE_MASK) | (capacity << CAPACITY_SHIFT));
  }
@Override
  public void setCapacity(int record, int capacity)