public static void writeUnsignedLeb128(ByteOutput out, int value) {
    int remaining = value >>> 7;

    while (remaining != 0) {
      out.writeByte((byte) ((value & 0x7f) | 0x80));
      value = remaining;
      remaining >>>= 7;
    }

    out.writeByte((byte) (value & 0x7f));
  }
Writes {@code value} as an unsigned integer to {@code out}, starting at {@code offset}. Returns
the number of bytes written.
android/android_framework/dex-maker/src/main/java/com/android/dex/Leb128.java