public static void readVInt(byte[] bytes, int offset, VInt vInt) {
    byte firstByte = bytes[offset];
    vInt.length = (byte) WritableUtils.decodeVIntSize(firstByte);
    if (vInt.length == 1) {
      vInt.value = firstByte;
      return;
    }
    int i = 0;
    for (int idx = 0; idx < vInt.length - 1; idx++) {
      byte b = bytes[offset + 1 + idx];
      i = i << 8;
      i = i | (b & 0xFF);
    }
    vInt.value = (WritableUtils.isNegativeVInt(firstByte) ? (i ^ -1) : i);
  }
Reads a zero-compressed encoded int from a byte array and returns it.

@param bytes
         the byte array
@param offset
         offset of the array to read from
@param vInt
         storing the deserialized int and its size in byte
serde/src/java/org/apache/hadoop/hive/serde2/lazybinary/LazyBinaryUtils.java