@Override
  public void setSize(int record, int size) throws IOException {
    markDirty();

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

    // size to fit in normal record [-1 .. 0xFFFF)
    if (size >= 0xFFFF || size < SPECIAL_NEGATIVE_SIZE_FOR_REMOVED_RECORD || forceSplit) {
      // introduce indirect record able to hold larger size range
      extendSizeAndCapacityRecord(record, size, getCapacity(record));
      return;
    }

    if (size == SPECIAL_NEGATIVE_SIZE_FOR_REMOVED_RECORD) {
      size = SPECIAL_POSITIVE_VALUE_FOR_SPECIAL_NEGATIVE_SIZE;
    }

    myStorage.putInt(sizeAndCapacityOfRecordAbsoluteOffset, size | (currentValue & CAPACITY_MASK));
  }
@Override
  public void setSize(int record, int size)