class LEB128 {

	public static int decode32u(BinaryReader reader) throws IOException {
		long tmp = decode(reader, false);

		// NOTE: will only be lt 0 if tmp's value was larger than what fits in signed long and it wrapped.
		if (tmp < 0 || tmp > Integer.MAX_VALUE) {
			throw new IOException("LEB128 value out of range for java 32 bit unsigned int: " +
				Long.toUnsignedString(tmp));
		}

		return (int) tmp;
	}

}