int (final ByteBuffer source, final int offset) { final byte headerByte0 = source.get(offset); final short headerBytes1_2 = source.getShort(offset + 1); final int packedCapacity = ((headerByte0 & CAPACITY_MASK_0) << CAPACITY_BITS_1_2) | (headerBytes1_2 & CAPACITY_MASK_1_2); final int capacity = (packedCapacity << OFFSET_BUCKET_BITS) + MIN_CAPACITY; assert capacity <= MAX_CAPACITY : "capacity(" + capacity + ") > MAX " + MAX_CAPACITY; return capacity; }