public static Pair<Integer, Integer> readVIntValuePart(Tag tag, int offset) throws IOException {
    if (tag.hasArray()) {
      return StreamUtils.readRawVarint32(tag.getValueArray(), offset);
    }
    return StreamUtils.readRawVarint32(tag.getValueByteBuffer(), offset);
  }
Reads an int value stored as a VInt at tag's given offset.
@param tag    The Tag
@param offset The offset where VInt bytes begin
@return A pair of the int value and number of bytes taken to store VInt
@throws IOException When varint is malformed and not able to be read correctly
hbase-common/src/main/java/org/apache/hadoop/hbase/TagUtil.java