Table of Contents

Method OpenGenericAsync

Namespace
AvroSharp.Containers
Assembly
AvroSharp.dll

OpenGenericAsync(Stream, AvroSchema?, AvroFileReaderOptions?, GenericDatumReaderOptions?, CancellationToken)

Reads a file's header asynchronously and returns a reader of its objects as generic values.

public static ValueTask<AvroFileReader<AvroValue>> OpenGenericAsync(Stream stream, AvroSchema? readerSchema = null, AvroFileReaderOptions? options = null, GenericDatumReaderOptions? readerOptions = null, CancellationToken cancellationToken = default)

Parameters

stream Stream

The source, positioned at the start of the file.

readerSchema AvroSchema

The schema to read the objects as, resolved against the file's schema; null reads them as written.

options AvroFileReaderOptions

The file options, or null for the defaults.

readerOptions GenericDatumReaderOptions

The generic reader's options, or null for the defaults.

cancellationToken CancellationToken

Cancels reading the header.

Returns

ValueTask<AvroFileReader<AvroValue>>