docs: private boolean actuallyFits(int powerTwo) throws IOException
    {
      long lastValueOffset = 0;
      long currentValueOffset = 0;
      long valueBytesWritten = valuesOut.size();
      long headerIndex = 0;
      long bagSize = 1L << powerTwo;
  
      while (lastValueOffset < valueBytesWritten) {
  
        if (headerIndex >= numWritten) {
          return true;
        } else if (headerIndex + bagSize <= numWritten) {
          currentValueOffset = headerOutLong.getLong(Ints.checkedCast(headerIndex + bagSize - 1));
        } else if (numWritten < headerIndex + bagSize) {
          currentValueOffset = headerOutLong.getLong(numWritten - 1);
        }
  
        if (currentValueOffset - lastValueOffset <= fileSizeLimit) {
          lastValueOffset = currentValueOffset;
          headerIndex = headerIndex + bagSize;
        } else {
          return false;
        }
      }
      return true;
    }