Mono.Cecil.Mixin.ReadCompressedUInt32 C# (CSharp) Method

ReadCompressedUInt32() public static method

public static ReadCompressedUInt32 ( this data, int &position ) : uint
data this
position int
return uint
        public static uint ReadCompressedUInt32(this byte [] data, ref int position)
        {
            uint integer;
            if ((data [position] & 0x80) == 0) {
                integer = data [position];
                position++;
            } else if ((data [position] & 0x40) == 0) {
                integer = (uint) (data [position] & ~0x80) << 8;
                integer |= data [position + 1];
                position += 2;
            } else {
                integer = (uint) (data [position] & ~0xc0) << 24;
                integer |= (uint) data [position + 1] << 16;
                integer |= (uint) data [position + 2] << 8;
                integer |= (uint) data [position + 3];
                position += 4;
            }
            return integer;
        }