Table of Contents

Method OpenAppendAsync

Namespace
AvroSharp.Containers
Assembly
AvroSharp.dll

OpenAppendAsync<T>(Stream, AvroSchema, AvroWriteAction<T>, AvroFileWriterOptions?, CancellationToken)

Opens a container file to append to, as OpenAppend<T>(Stream, AvroSchema, AvroWriteAction<T>, AvroFileWriterOptions?) does, reading its header asynchronously.

public static ValueTask<AvroFileWriter<T>> OpenAppendAsync<T>(Stream stream, AvroSchema schema, AvroWriteAction<T> write, AvroFileWriterOptions? options = null, CancellationToken cancellationToken = default)

Parameters

stream Stream

The file: readable, writable and seekable.

schema AvroSchema

The schema of the objects; it must be the file's (the same canonical form).

write AvroWriteAction<T>

Writes one object in schema's encoding.

options AvroFileWriterOptions

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

cancellationToken CancellationToken

Cancels reading the header.

Returns

ValueTask<AvroFileWriter<T>>

Type Parameters

T

The type of the objects.

Exceptions

ArgumentException

The stream can't be read, written and seeked, or the options have metadata.

AvroException

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

AvroDataException

The file's header is malformed.

OpenAppendAsync<T>(Stream, AvroFileWriterOptions?, CancellationToken)

Opens a container file of a generated type to append to, reading its header asynchronously.

public static ValueTask<AvroFileWriter<T>> OpenAppendAsync<T>(Stream stream, AvroFileWriterOptions? options = null, CancellationToken cancellationToken = default) where T : IAvroSerializable<T>

Parameters

stream Stream

The file: readable, writable and seekable.

options AvroFileWriterOptions

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

cancellationToken CancellationToken

Cancels reading the header.

Returns

ValueTask<AvroFileWriter<T>>

Type Parameters

T

A generated type.

Exceptions

ArgumentException

The stream can't be read, written and seeked, or the options have metadata.

AvroException

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

AvroDataException

The file's header is malformed.