public int updateIntField(int fileId,
                            int fieldOffsetInRow,
                            @NotNull IntUnaryOperator updateOperator) throws IOException {
    long offsetInFile = toOffsetInFile(fileId) + fieldOffsetInRow;
    int offsetInPage = storage.toOffsetInPage(offsetInFile);

    Page page = storage.pageByOffset(offsetInFile);
    ByteBuffer rawPageBuffer = page.rawPageBuffer();
    while (true) {//CAS loop:
      int currentValue = (int)INT_HANDLE.getVolatile(rawPageBuffer, offsetInPage);
      int newValue = updateOperator.applyAsInt(currentValue);
      if (INT_HANDLE.compareAndSet(rawPageBuffer, offsetInPage, currentValue, newValue)) {
        return currentValue;
      }
    }
  }
public int updateIntField(int fileId,
                            int fieldOffsetInRow,
                            @NotNull IntUnaryOperator updateOperator)