private int deserialize_uleb128_as_u32()

in serde-generate/runtime/java/com/novi/bcs/BcsDeserializer.java [23:40]


    private int deserialize_uleb128_as_u32() throws DeserializationError {
        long value = 0;
        for (int shift = 0; shift < 32; shift += 7) {
            byte x = getByte();
            byte digit = (byte) (x & 0x7F);
            value = value | ((long)digit << shift);
            if ((value < 0) || (value > Integer.MAX_VALUE)) {
                throw new DeserializationError("Overflow while parsing uleb128-encoded uint32 value");
            }
            if (digit == x) {
                if (shift > 0 && digit == 0) {
                    throw new DeserializationError("Invalid uleb128 number (unexpected zero digit)");
                }
                return (int) value;
            }
        }
        throw new DeserializationError("Overflow while parsing uleb128-encoded uint32 value");
    }