code: public final static void writeVInt(BytesRef dst, int i) {
      while ((i & ~0x7F) != 0) {
        dst.bytes[dst.offset++] = (byte) ((i & 0x7f) | 0x80);
        i >>>= 7;
      }
      dst.bytes[dst.offset++] = (byte) i;
    }
docs: Writes an int in a variable-length format.
  Writes 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 #writeInt}.