Class ZstdCodec
Zstandard compression at zstd's maximum level, matching MAME's
chd_zstd_compressor (ZSTD_maxCLevel()).
public sealed class ZstdCodec : IChdCodec
- Inheritance
-
ZstdCodec
- Implements
- Inherited Members
Remarks
Backed by the managed ZstdSharp.Port 0.7.6 port of libzstd 1.5.5 - the exact version
MAME 0.288 ships - keeping the encoder 100% pure C# and cross-platform. Compression is
one-shot via ZSTD_compress2, which writes the single-segment frame header with the
declared content size; the 1.5.5 encoder emits frames byte-identical to chdman for both raw
and CD compound ('cdzs') hunks (verified per-hunk against chdman on the battle-test corpus).
Constructors
ZstdCodec()
Creates the codec.
public ZstdCodec()
Properties
Tag
The four-character codec tag (see CodecTags).
public uint Tag { get; }
Property Value
Methods
Compress(byte[])
Compresses a full hunk. Returns null when the codec does not reduce the size.
public byte[]? Compress(byte[] data)
Parameters
databyte[]
Returns
- byte[]