src/Orleans.Serialization/Buffers/Reader.cs
/// <summary>
/// Reads a <see cref="uint"/> from the input.
/// </summary>
/// <returns>The <see cref="uint"/> which was read.</returns>
Reads a  from the input.
Reads a from the input .
public uint ReadUInt32()
        {
            if (IsReadOnlySequenceInput || IsSpanInput)
            {
                const int width = 4;
                if (_bufferPos + width > _bufferSize)
                {
                    return ReadSlower(ref this);
                }
                var result = BinaryPrimitives.ReadUInt32LittleEndian(_currentSpan.Slice(_bufferPos, width));
                _bufferPos += width;
                return result;
                static uint ReadSlower(ref Reader<TInput> r)
                {
                    uint b1 = r.ReadByte();
                    uint b2 = r.ReadByte();
                    uint b3 = r.ReadByte();
                    uint b4 = r.ReadByte();
                    return b1 | (b2 << 8) | (b3 << 16) | (b4 << 24);
                }
            }
            else if (_input is ReaderInput readerInput)
            {
                return readerInput.ReadUInt32();
            }
            else
            {
                return ThrowNotSupportedInput<uint>();
            }
        }
public uint ReadUInt32 ( ) { if ( IsReadOnlySequenceInput || IsSpanInput ) { const int width = 4 ; if ( _bufferPos + width > _bufferSize ) { return ReadSlower ( ref this ) ; } var result = BinaryPrimitives . ReadUInt32LittleEndian ( _currentSpan . Slice ( _bufferPos , width ) ) ; _bufferPos += width ; return result ; static uint ReadSlower ( ref Reader < TInput > r ) { uint b1 = r . ReadByte ( ) ; uint b2 = r . ReadByte ( ) ; uint b3 = r . ReadByte ( ) ; uint b4 = r . ReadByte ( ) ; return b1 | ( b2 << 8 ) | ( b3 << 16 ) | ( b4 << 24 ) ; } } else if ( _input is ReaderInput readerInput ) { return readerInput . ReadUInt32 ( ) ; } else { return ThrowNotSupportedInput < uint > ( ) ; } }
Reads a  from the input.
Reads a from the input .
The  which was read.
The which was read .