public static int readCompressedInt(ByteBuffer buffer) {
        byte b = buffer.get();
        if ((b & NEXT_BIT_MASK) != 0) {
            return (b & VALUE_MASK) + (readCompressedInt(buffer) << NEXT_BIT_SHIFT);
        }
        return b & VALUE_MASK;
    }
Read integer from buffer coded in 7 bits and increment position.

@return Read integer.
stroom-bytebuffer/src/main/java/stroom/bytebuffer/hbase/ByteBufferUtils.java