public final int limit() {
        return buffer.limit();
    }
Behaves as ByteBuffer slicing, but the internal buffer will no longer be
shared if one of the buffers is forced to grow.

@return a new buffer with shared contents
@see ByteBuffer#slice()
vespajlib/src/main/java/com/yahoo/io/GrowableByteBuffer.java