Delegate MessagePackStreamingReader.GetMoreBytesAsync
- Namespace
- Nerdbank.MessagePack
- Assembly
- Nerdbank.MessagePack.dll
A delegate that can be used to get more bytes to complete the operation.
public delegate ValueTask<ReadResult> MessagePackStreamingReader.GetMoreBytesAsync(object? state, SequencePosition consumed, SequencePosition examined, CancellationToken cancellationToken)
Parameters
state
objectA state object.
consumed
SequencePositionThe position after the last consumed byte (i.e. the last byte from the original buffer that is not expected to be included to the new buffer). Any bytes at or following this position that were in the original buffer must be included to the buffer returned from this method.
examined
SequencePositionThe position of the last examined byte. This should be passed to AdvanceTo(SequencePosition, SequencePosition) when applicable to ensure that the request to get more bytes is filled with actual more bytes rather than the existing buffer.
cancellationToken
CancellationTokenA cancellation token.
Returns
- ValueTask<ReadResult>
The available buffer, which must contain more bytes than remained after
consumed
if there are any more bytes to be had.