Table of Contents

Method OpenAppendGenericAsync

Namespace
AvroSharp.Containers
Assembly
AvroSharp.dll

OpenAppendGenericAsync(Stream, AvroSchema?, AvroFileWriterOptions?, GenericDatumWriterOptions?, CancellationToken)

Opens a container file to append generic values to, as OpenAppendGeneric(Stream, AvroSchema?, AvroFileWriterOptions?, GenericDatumWriterOptions?) does, reading its header asynchronously.

public static ValueTask<AvroFileWriter<AvroValue>> OpenAppendGenericAsync(Stream stream, AvroSchema? schema = null, AvroFileWriterOptions? options = null, GenericDatumWriterOptions? writerOptions = null, CancellationToken cancellationToken = default)

Parameters

stream Stream

The file: readable, writable and seekable.

schema AvroSchema

The schema of the values, or null for the file's; an empty stream needs one.

options AvroFileWriterOptions

The file options, or null for the defaults; see OpenAppend<T>(Stream, AvroSchema, AvroWriteAction<T>, AvroFileWriterOptions?).

writerOptions GenericDatumWriterOptions

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

cancellationToken CancellationToken

Cancels reading the header.

Returns

ValueTask<AvroFileWriter<AvroValue>>

Exceptions

ArgumentException

The stream can't be read, written and seeked, the options have metadata, or the stream is empty and no schema is given.

AvroException

The file's schema or codec is not the writer's.

AvroDataException

The file's header is malformed.