src/Orleans.Serialization/Buffers/Reader.cs
/// <summary>
/// Tries the read the specified number of bytes from the input.
/// </summary>
/// <param name="length">The length.</param>
/// <param name="bytes">The bytes which were read.</param>
/// <returns><see langword="true"/> if the specified number of bytes were read from the input, <see langword="false"/> otherwise.</returns>
Tries the read the specified number of bytes from the input.
Tries the read the specified number of bytes from the input .
[MethodImpl(MethodImplOptions.AggressiveInlining)]
        public bool TryReadBytes(int length, out ReadOnlySpan<byte> bytes)
        {
            if (IsReadOnlySequenceInput || IsSpanInput)
            {
                if (_bufferPos + length <= _bufferSize)
                {
                    bytes = _currentSpan.Slice(_bufferPos, length);
                    _bufferPos += length;
                    return true;
                }
                bytes = default;
                return false;
            }
            else if (_input is ReaderInput readerInput)
            {
                return readerInput.TryReadBytes(length, out bytes);
            }
            else
            {
                bytes = default;
                return ThrowNotSupportedInput<bool>();
            }
        }
[ MethodImpl ( MethodImplOptions . AggressiveInlining ) ] public bool TryReadBytes ( int length , out ReadOnlySpan < byte > bytes ) { if ( IsReadOnlySequenceInput || IsSpanInput ) { if ( _bufferPos + length <= _bufferSize ) { bytes = _currentSpan . Slice ( _bufferPos , length ) ; _bufferPos += length ; return true ; } bytes = default ; return false ; } else if ( _input is ReaderInput readerInput ) { return readerInput . TryReadBytes ( length , out bytes ) ; } else { bytes = default ; return ThrowNotSupportedInput < bool > ( ) ; } }
Tries the read the specified number of bytes from the input.
Tries the read the specified number of bytes from the input .
if the specified number of bytes were read from the input,  otherwise.
if the specified number of bytes were read from the input otherwise .
length
int
None
ReadOnlySpan<byte>
out
bytes
The bytes which were read.
The bytes which were read .