Skip to content

IOFileFormat.ReadAsync Method ​

Overloads ​

NameDescription
ReadAsync(Stream, CancellationToken)Reads a file from a stream asynchronously.
ReadAsync(IBinaryReader)Reads a file from an IBinaryReader.

ReadAsync(Stream, CancellationToken) ​

Reads a file from a stream asynchronously.

c#
public Task<IOFile> ReadAsync(Stream stream, CancellationToken cancellationToken = null);

Parameters ​

NameTypeDescription
streamStreamThe stream to read from.
cancellationTokenCancellationTokenAn optional CancellationToken to cancel the reading.

Returns ​

Task<IOFile>

The file that was read.

ReadAsync(IBinaryReader) ​

Reads a file from an IBinaryReader.

c#
protected abstract ValueTask<IOFile> ReadAsync(IBinaryReader reader);

Parameters ​

NameTypeDescription
readerIBinaryReaderThe IBinaryReader to read from.

Returns ​

ValueTask<IOFile>

The file that was read.