public static int readUnsignedInt(ByteInput in, int zwidth, boolean fillOnRight) {
    int result = 0;
    if (!fillOnRight) {
      for (int i = zwidth; i >= 0; i--) {
        result = (result >>> 8) | ((in.readByte() & 0xff) << 24);
      }
      result >>>= (3 - zwidth) * 8;
    } else {
      for (int i = zwidth; i >= 0; i--) {
        result = (result >>> 8) | ((in.readByte() & 0xff) << 24);
      }
    }
    return result;
  }
Read an unsigned integer.

@param zwidth byte count minus one
@param fillOnRight true to zero fill on the right; false on the left
android/android_framework/dex-maker/src/main/java/com/android/dex/EncodedValueCodec.java