Quick look at the ZstandardEncoder class in .NET 11
Posted: (EET/GMT+2)
Microsoft's new .NET version 11 (due this November) contains many new features, and one small but interesting part of the Zstandard (Zstd) compression support. The new classes related to this are being added to the System.IO.Compression namespace.
For example, the ZstandardEncoder class allows you to compress data with the given quality rating. In Zstandard, you can set the compression ratio, somewhat like you can set the compression level in zip or 7-Zip files. Also, the so called window size can be configured.
The current C# implementation on GitHub is a little scarce, but for .NET 11, it's still quite early. We'll have to wait and see what turns out of this class and what the final properties and methods are named.
Also note that at least currently, there are no plans to support Zstandard compression on web assembly/browser environments:
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
[System.Runtime.Versioning.UnsupportedOSPlatform("wasi")]
For more information, it's also worth checking RFC 8878 from February 2021.