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