SubStreamReadAsync(MemoryByte, CancellationToken) - метод

Asynchronously reads a sequence of bytes from the current stream, advances the position within the stream by the number of bytes read, and monitors cancellation requests.

Definition

Пространство имён: Tessa.Platform.IO
Сборка: Tessa (в Tessa.dll) Версия: 3.6.0.22
C#
public override ValueTask<int> ReadAsync(
	Memory<byte> buffer,
	CancellationToken cancellationToken = default
)

Параметры

buffer  MemoryByte
The region of memory to write the data into.
cancellationToken  CancellationToken  (Optional)
The token to monitor for cancellation requests. The default value is None.

Возвращаемое значение

ValueTaskInt32
A task that represents the asynchronous read operation. The value of its Result property contains the total number of bytes read into the buffer. The result value can be less than the number of bytes allocated in the buffer if that many bytes are not currently available, or it can be 0 (zero) if the end of the stream has been reached.

См. также