public static long readVLongFromByteArray(final byte[] bytes, int offset) {
    byte firstByte = bytes[offset++];
    int len = WritableUtils.decodeVIntSize(firstByte);
    if (len == 1) {
      return firstByte;
    }
    long i = 0;
    for (int idx = 0; idx < len-1; idx++) {
      byte b = bytes[offset++];
      i = i << 8;
      i = i | (b & 0xFF);
    }
    return (WritableUtils.isNegativeVInt(firstByte) ? ~i : i);
  }
Read a zero-compressed encoded long from a byte array.

@param bytes the byte array
@param offset the offset in the byte array where the VLong is stored
@return the long
serde/src/java/org/apache/hadoop/hive/serde2/lazybinary/LazyBinaryUtils.java