Method
Read
abstract virtual func Read(buffer: byte[], offset: int, count: int, cancellationToken: CancellationToken = default) -> Task<Result<int, StreamError>>
Declaring type: InputStream
Module: System.IO
Assembly: System.Runtime.dll
Source file: InputStream.rvn
Defined by InputStream.Read · Required implementation (no default).
Interface implementation: Required implementation (no default).
Reads up to count bytes; a positive-count read returns zero only at EOF.
Parameters
| Name | Type | Description |
|---|---|---|
buffer |
Byte[] | Destination whose bytes outside the requested range are preserved. |
offset |
Int32 | First destination index. |
count |
Int32 | Maximum bytes to read; zero completes without consuming input. |
cancellationToken |
CancellationToken | Cancellation produces a cancelled task, not a StreamError. |
Return value
Task<Result<Int32, StreamError>>
A byte count or stream error. Short reads are successful.