Class ZstandardCodec
The zstandard codec: each block is one or more Zstandard frames. Reading accepts frames with or without
a content checksum and with or without the decompressed size, as Java's streaming writer produces them.
public sealed class ZstandardCodec : AvroCodec
- Inheritance
-
ZstandardCodec
- Inherited Members
Remarks
Uses the fully managed ZstdSharp library. Instances are thread-safe: compression and decompression contexts are kept per thread and reused.
Constructors
- ZstandardCodec(int, bool)
Creates a zstandard codec.
Fields
- DefaultLevel
The default compression level, 3, the same as Java's
CodecFactory.zstandardCodec.
Properties
- Checksum
Gets whether written frames carry a checksum of their content.
- Default
Gets the codec with the DefaultLevel and no checksum.
- Level
Gets the compression level.
- MaxLevel
Gets the highest (smallest output) compression level.
- MinLevel
Gets the lowest (fastest) compression level.
- Name
Gets the name written to the file's
avro.codecmetadata entry, for exampledeflate.
Methods
- Compress(ReadOnlyMemory<byte>, IBufferWriter<byte>)
Compresses one block.
- Decompress(ReadOnlyMemory<byte>, IBufferWriter<byte>)
Decompresses one block. The destination refuses to grow past the reader's block limit, so an implementation needs no limit of its own; it should throw InvalidDataException for corrupt data.
- ToString()
Returns a string that represents the current object.