@Override
  public <OUT, E extends Exception> OUT write(final int startOffsetOnPage,
                                              final int length,
                                              final ThrowableNotNullFunction<ByteBuffer, OUT, E> writer) throws E {
    contentProtectingLock.writeLock().lock();
    try {
      checkPageIsValidForAccess();

      //RC: need to upgrade language level to 13 to use .slice(index, length)
      final ByteBuffer slice = data.duplicate()
        .order(data.order());
      slice.position(startOffsetOnPage)
        .limit(startOffsetOnPage + length);
      try {
        return writer.fun(slice);
      }
      finally {
        regionModified(startOffsetOnPage, length);
        checkPageIsValidForAccess();
      }
    }
    finally {
      contentProtectingLock.writeLock().unlock();
    }
  }
@Override
  public <OUT, E extends Exception> OUT write(final int startOffsetOnPage,
                                              final int length,
                                              final ThrowableNotNullFunction<ByteBuffer, OUT, E> writer)