Method
Read
func Read(buffer: byte[], offset: int, count: int, cancellationToken: CancellationToken = default) -> Task<Result<int, StreamError>>
Declaring type: MemoryStream
Module: System.IO
Assembly: System.Runtime.dll
Source file: MemoryStream.rvn
Implements InputStream.Read
Reads memory synchronously and returns a settled task; no worker is scheduled.
Parameters
| Name | Type | Description |
|---|---|---|
buffer |
Byte[] | |
offset |
Int32 | |
count |
Int32 | |
cancellationToken |
CancellationToken |
Return value
Task<Result<Int32, StreamError>>
Remarks
Pre-cancellation wins before validation or mutation. Other errors match Read. This shared-cursor stream is not thread-safe.