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
streamStreamThe file: readable, writable and seekable.
schemaAvroSchemaThe schema of the values, or null for the file's; an empty stream needs one.
optionsAvroFileWriterOptionsThe file options, or null for the defaults; see OpenAppend<T>(Stream, AvroSchema, AvroWriteAction<T>, AvroFileWriterOptions?).
writerOptionsGenericDatumWriterOptionsThe generic writer's options, or null for the defaults.
cancellationTokenCancellationTokenCancels reading the header.
Returns
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.