Method OpenAsync
OpenAsync(FileId, FileAccessPattern)
Opens a read-only, seekable stream over the content of an existing main file. The caller owns the stream and must dispose it.
Declaration
ValueTask<Stream> OpenAsync(FileId fileId, FileAccessPattern accessPattern)
Parameters
| Type | Name | Description |
|---|---|---|
| FileId | fileId | The ID of the file. |
| FileAccessPattern | accessPattern | How the caller is going to read the stream: from start to end, or by seeking within it. This is a hint that the implementation may use to choose how it reads the content; the stream can be read either way. |
Returns
| Type | Description |
|---|---|
| ValueTask<Stream> |
Remarks
This is equivalent to GetAsync(FileId) followed by OpenReadAsync(FileAccessPattern, CancellationToken), and the stream behaves the same way: it is seekable, may support only asynchronous reads, and the access pattern is only a hint.
Exceptions
| Type | Condition |
|---|---|
| RepoFileNotFoundException | The file does not exist. |