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
streamStreamThe file: readable, writable and seekable.
schemaAvroSchemaThe schema of the objects; it must be the file's (the same canonical form).
writeAvroWriteAction<T>Writes one object in
schema's encoding.optionsAvroFileWriterOptionsThe file options, or null for the defaults; see OpenAppend<T>(Stream, AvroSchema, AvroWriteAction<T>, AvroFileWriterOptions?).
cancellationTokenCancellationTokenCancels reading the header.
Returns
Type Parameters
TThe 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
streamStreamThe file: readable, writable and seekable.
optionsAvroFileWriterOptionsThe file options, or null for the defaults; see OpenAppend<T>(Stream, AvroSchema, AvroWriteAction<T>, AvroFileWriterOptions?).
cancellationTokenCancellationTokenCancels reading the header.
Returns
Type Parameters
TA 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.