code: public final static int readVInt(BytesRef src) {
      byte b = src.bytes[src.offset++];
      int i = b & 0x7F;
      if ((b & 0x80) == 0) {
        return i;
      }
      b = src.bytes[src.offset++];
      i |= (b & 0x7F) << 7;
      if ((b & 0x80) == 0) {
        return i;
      }
      b = src.bytes[src.offset++];
      i |= (b & 0x7F) << 14;
      if ((b & 0x80) == 0) {
        return i;
      }
      b = src.bytes[src.offset++];
      i |= (b & 0x7F) << 21;
      if ((b & 0x80) == 0) {
        return i;
      }
      b = src.bytes[src.offset++];
      assert (b & 0x80) == 0;
      return i | ((b & 0x7F) << 28);
    }
docs: Reads an int stored in variable-length format.  Reads between one and
  five bytes.  Smaller values take fewer bytes.  Negative numbers
  will always use all 5 bytes and are therefore better serialized
  using {@link #readInt}