Namespace AvroSharp.Containers
Avro object container files, sync and async. AvroFileWriter creates writers and AvroFileReader opens readers, for generated types or, through CreateGeneric and OpenGeneric, for the generic values of AvroSharp.Generic. A reader, AvroFileReader<T>, can seek to sync markers and read blocks in a pipeline.
AvroFileWriterOptionssets the codec, the sync interval and the metadata.AvroFileReaderOptionssets the codecs a reader accepts and its limits.AvroCodecis the base class of the block codecs. This namespace has the null codec andDeflateCodec.AvroCodecNamesholds the codec names of the specification.
The other codecs are in AvroSharp.Codecs, in the AvroSharp.Codecs package.
Classes
- AvroCodec
A compression codec for the blocks of an object container file. The null and deflate codecs are built in; other codecs (snappy, zstandard, bzip2, xz) are in the AvroSharp.Codecs package; any subclass can be passed to Codec and Codecs.
- AvroCodecNames
The codec names registered by the Avro specification for the
avro.codecmetadata entry of an object container file.
- AvroFileReader
Opens AvroFileReader<T> instances.
- AvroFileReaderOptions
Options for AvroFileReader<T>.
- AvroFileReader<T>
Reads an Avro object container file: the header when opened, then the objects block by block. Each block is read whole, checked against the sync marker and decompressed before its objects are decoded. Reading is synchronous (TryRead(out T), ReadAll()) or asynchronous (ReadAllAsync(CancellationToken)); the asynchronous path does no synchronous I/O, and decodes each block synchronously once it is in memory.
- AvroFileWriter
Creates AvroFileWriter<T> instances.
- AvroFileWriterOptions
Options for AvroFileWriter<T>.
- AvroFileWriter<T>
Writes an Avro object container file: a header holding the schema, then blocks of objects, each compressed with the file's codec and followed by the sync marker. Objects are buffered until a block reaches SyncInterval or 65,536 objects; Flush() and Dispose() write the rest. The header is written with the first block, or when the writer is flushed or disposed. The asynchronous members (WriteAsync(T, CancellationToken), FlushAsync(CancellationToken), DisposeAsync()) do no synchronous I/O.
- DeflateCodec
The
deflatecodec: raw DEFLATE (RFC 1951) without zlib framing, as the specification requires, using the BCL's DeflateStream.