code: static int writeVInt(byte[] array, int offset, int value) {
      assert value >= 0 : "Can't v-code negative ints.";
  
      while (value > 0x7F) {
        array[offset++] = (byte) (0x80 | (value & 0x7F));
        value >>= 7;
      }
      array[offset++] = (byte) value;
  
      return offset;
    }
docs: Write a v-int to a byte array.