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.
hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferUtils.java