private void checkSufficientCapacity() {
        final int requiredCapacityInBytes = getRequiredBufferSize(maximumCapacity, elementSize);
        if (buffer.capacity() < requiredCapacityInBytes) {
            throw new IllegalArgumentException("Failed to meet required maximumCapacity in bytes: "
                    + requiredCapacityInBytes);
        }
    }
This is to be used for an IPC queue with the direct buffer used being a memory mapped file.

@param buffer
@param requestedCapacity
jctools-channels/src/main/java/org/jctools/channels/spsc/SpscChannel.java