Skip to content
API referenceDevelopmentEngine APIEngine ccf7d03f
Synced
  • 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.

API: engine
Project: Inno.Core.IO

public override System.Threading.Tasks.ValueTask<int> Inno.Core.IO.OwnedReadStream.ReadAsync(System.Memory<byte> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))

Parameter buffer: The region of memory to write the data into.

Parameter cancellationToken: The token to monitor for cancellation requests. The default value is P:System.Threading.CancellationToken.None.

Exception T:System.OperationCanceledException: The cancellation token was canceled. This exception is stored into the returned task.

A task that represents the asynchronous read operation. The value of its P:System.Threading.Tasks.ValueTask`1.Result property contains the total number of bytes read into the buffer. The result value can be less than the length of the buffer if that many bytes are not currently available, or it can be 0 (zero) if the length of the buffer is 0 or if the end of the stream has been reached.