AsmResolver.BinaryStreamReaderExtensions.ReadCompressedUInt32 C# (CSharp) Метод

ReadCompressedUInt32() публичный статический Метод

Reads a compressed unsigned integer from the stream.
public static ReadCompressedUInt32 ( this reader ) : uint
reader this The reader to use for reading the data.
Результат uint
        public static uint ReadCompressedUInt32(this IBinaryStreamReader reader)
        {
            var firstByte = reader.ReadByte();

            if ((firstByte & 0x80) == 0)
                return firstByte;

            if ((firstByte & 0x40) == 0)
                return (uint)(((firstByte & 0x7F) << 8) | reader.ReadByte());

            return (uint)(((firstByte & 0x3F) << 0x18) |
                          (reader.ReadByte() << 0x10) |
                          (reader.ReadByte() << 0x08) |
                          reader.ReadByte());
        }