< Summary

Line coverage
0%
Covered lines: 0
Uncovered lines: 275
Coverable lines: 275
Total lines: 511
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 62
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor()100%110%
.ctor(...)0%220%
.ctor(...)100%110%
.ctor(...)0%440%
.ctor(...)0%220%
.ctor(...)0%14140%
InitializeEncoder()0%220%
Compress(...)0%660%
Flush(...)100%110%
CompressCore(...)0%880%
GetMaxCompressedLength(...)0%440%
TryCompress(...)100%110%
TryCompress(...)100%110%
TryCompress(...)100%110%
TryCompressCore(...)0%880%
Reset()100%110%
SetPrefix(...)0%440%
SetSourceLength(...)0%440%
Dispose()100%110%
EnsureNotDisposed()100%110%
SetQuality(...)0%220%
SetWindowLog(...)0%220%
SetDictionary(...)100%110%
SetParameter(...)100%110%

File(s)

https://raw.githubusercontent.com/dotnet/runtime/811a7eabb75c42db53440e8ba3f60c07511cfd1f/src/libraries/System.IO.Compression/src/System/IO/Compression/Zstandard/ZstandardEncoder.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4using System.Buffers;
 5using System.Diagnostics;
 6using System.Diagnostics.CodeAnalysis;
 7using System.Runtime.InteropServices;
 8using Microsoft.Win32.SafeHandles;
 9
 10namespace System.IO.Compression
 11{
 12    /// <summary>Provides methods and properties to compress data using Zstandard compression.</summary>
 13    [System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
 14    [System.Runtime.Versioning.UnsupportedOSPlatform("wasi")]
 15    public sealed class ZstandardEncoder : IDisposable
 16    {
 17        internal SafeZstdCompressHandle _context;
 18        private bool _disposed;
 19
 20        /// <summary>
 21        /// True if we finished compressing the entire input.
 22        /// </summary>
 23        private bool _finished;
 24
 25        /// <summary>Initializes a new instance of the <see cref="ZstandardEncoder"/> class with default settings.</summ
 26        /// <exception cref="IOException">Failed to create the <see cref="ZstandardEncoder"/> instance.</exception>
 027        public ZstandardEncoder()
 028        {
 029            _disposed = false;
 030            InitializeEncoder();
 031        }
 32
 33        /// <summary>Initializes a new instance of the <see cref="ZstandardEncoder"/> class with the specified quality l
 34        /// <param name="quality">The compression quality level.</param>
 35        /// <exception cref="ArgumentOutOfRangeException"><paramref name="quality"/> is not between the minimum and maxi
 36        /// <exception cref="IOException">Failed to create the <see cref="ZstandardEncoder"/> instance.</exception>
 037        public ZstandardEncoder(int quality)
 038        {
 039            _disposed = false;
 040            InitializeEncoder();
 41
 42            try
 043            {
 044                if (quality != 0)
 045                {
 046                    SetQuality(_context, quality);
 047                }
 048            }
 049            catch
 050            {
 051                _context.Dispose();
 052                throw;
 53            }
 054        }
 55
 56        /// <summary>Initializes a new instance of the <see cref="ZstandardEncoder"/> class with the specified dictionar
 57        /// <param name="dictionary">The compression dictionary to use.</param>
 58        /// <exception cref="ArgumentNullException"><paramref name="dictionary"/> is null.</exception>
 59        /// <exception cref="IOException">Failed to create the <see cref="ZstandardEncoder"/> instance.</exception>
 060        public ZstandardEncoder(ZstandardDictionary dictionary)
 061        {
 062            _disposed = false;
 063            InitializeEncoder();
 64
 65            try
 066            {
 067                SetDictionary(dictionary);
 068            }
 069            catch
 070            {
 071                _context.Dispose();
 072                throw;
 73            }
 074        }
 75
 76        /// <summary>Initializes a new instance of the <see cref="ZstandardEncoder"/> class with the specified quality a
 77        /// <param name="quality">The compression quality level.</param>
 78        /// <param name="windowLog2">The base-2 logarithm of the window size for compression.</param>
 79        /// <exception cref="ArgumentOutOfRangeException"><paramref name="quality"/> is not between the minimum and maxi
 80        /// <exception cref="IOException">Failed to create the <see cref="ZstandardEncoder"/> instance.</exception>
 081        public ZstandardEncoder(int quality, int windowLog2)
 082        {
 083            _disposed = false;
 084            InitializeEncoder();
 85
 86            try
 087            {
 088                if (quality != 0)
 089                {
 090                    SetQuality(_context, quality);
 091                }
 092                if (windowLog2 != 0)
 093                {
 094                    SetWindowLog(_context, windowLog2);
 095                }
 096            }
 097            catch
 098            {
 099                _context.Dispose();
 0100                throw;
 101            }
 0102        }
 103
 104        /// <summary>Initializes a new instance of the <see cref="ZstandardEncoder"/> class with the specified dictionar
 105        /// <param name="dictionary">The compression dictionary to use.</param>
 106        /// <param name="windowLog2">The base-2 logarithm of the window size for compression.</param>
 107        /// <exception cref="ArgumentNullException"><paramref name="dictionary"/> is null.</exception>
 108        /// <exception cref="ArgumentOutOfRangeException"><paramref name="windowLog2"/> is not between the minimum and m
 109        /// <exception cref="IOException">Failed to create the <see cref="ZstandardEncoder"/> instance.</exception>
 0110        public ZstandardEncoder(ZstandardDictionary dictionary, int windowLog2)
 0111        {
 0112            ArgumentNullException.ThrowIfNull(dictionary);
 113
 0114            _disposed = false;
 0115            InitializeEncoder();
 116
 117            try
 0118            {
 0119                SetDictionary(dictionary);
 120
 0121                if (windowLog2 != 0)
 0122                {
 0123                    SetWindowLog(_context, windowLog2);
 0124                }
 0125            }
 0126            catch
 0127            {
 0128                _context.Dispose();
 0129                throw;
 130            }
 0131        }
 132
 133        /// <summary>Initializes a new instance of the <see cref="ZstandardEncoder"/> class with the specified compressi
 134        /// <param name="compressionOptions">The compression options to use.</param>
 135        /// <exception cref="ArgumentNullException"><paramref name="compressionOptions"/> is null.</exception>
 136        /// <exception cref="ArgumentOutOfRangeException">A parameter from <paramref name="compressionOptions"/> is not 
 137        /// <exception cref="IOException">Failed to create the <see cref="ZstandardEncoder"/> instance.</exception>
 0138        public ZstandardEncoder(ZstandardCompressionOptions compressionOptions)
 0139        {
 0140            ArgumentNullException.ThrowIfNull(compressionOptions);
 141
 0142            _disposed = false;
 0143            InitializeEncoder();
 144
 145            try
 0146            {
 0147                if (compressionOptions.Dictionary is not null)
 0148                {
 0149                    SetDictionary(compressionOptions.Dictionary);
 0150                }
 151                else
 0152                {
 0153                    SetQuality(_context, compressionOptions.Quality);
 0154                }
 155
 0156                if (compressionOptions.WindowLog2 != 0)
 0157                {
 0158                    SetWindowLog(_context, compressionOptions.WindowLog2);
 0159                }
 160
 0161                if (compressionOptions.AppendChecksum)
 0162                {
 0163                    SetParameter(_context, Interop.Zstd.ZstdCParameter.ZSTD_c_checksumFlag, 1);
 0164                }
 165
 0166                if (compressionOptions.EnableLongDistanceMatching)
 0167                {
 0168                    SetParameter(_context, Interop.Zstd.ZstdCParameter.ZSTD_c_enableLongDistanceMatching, 1);
 0169                }
 170
 0171                if (compressionOptions.TargetBlockSize != 0)
 0172                {
 0173                    SetParameter(_context, Interop.Zstd.ZstdCParameter.ZSTD_c_targetCBlockSize, compressionOptions.Targe
 0174                }
 175
 0176                if (compressionOptions.HashLog2 != 0)
 0177                {
 0178                    SetParameter(_context, Interop.Zstd.ZstdCParameter.ZSTD_c_hashLog, compressionOptions.HashLog2);
 0179                }
 180
 0181                if (compressionOptions.ChainLog2 != 0)
 0182                {
 0183                    SetParameter(_context, Interop.Zstd.ZstdCParameter.ZSTD_c_chainLog, compressionOptions.ChainLog2);
 0184                }
 0185            }
 0186            catch
 0187            {
 0188                _context.Dispose();
 0189                throw;
 190            }
 0191        }
 192
 193        [MemberNotNull(nameof(_context))]
 194        private void InitializeEncoder()
 0195        {
 0196            _context = Interop.Zstd.ZSTD_createCCtx();
 0197            if (_context.IsInvalid)
 0198            {
 0199                throw new OutOfMemoryException();
 200            }
 0201        }
 202
 203        /// <summary>Compresses the specified data.</summary>
 204        /// <param name="source">The data to compress.</param>
 205        /// <param name="destination">The buffer to write the compressed data to.</param>
 206        /// <param name="bytesConsumed">When this method returns, contains the number of bytes consumed from the source.
 207        /// <param name="bytesWritten">When this method returns, contains the number of bytes written to the destination
 208        /// <param name="isFinalBlock"><see langword="true" /> if this is the final block of data to compress.</param>
 209        /// <returns>An <see cref="OperationStatus"/> indicating the result of the operation.</returns>
 210        /// <exception cref="ObjectDisposedException">The encoder has been disposed.</exception>
 211        /// <exception cref="IOException">An error occurred during compression.</exception>
 212        public OperationStatus Compress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesConsumed, out in
 0213        {
 0214            EnsureNotDisposed();
 215
 0216            bytesConsumed = 0;
 0217            bytesWritten = 0;
 218
 0219            if (source.IsEmpty && !isFinalBlock)
 0220            {
 0221                return OperationStatus.Done;
 222            }
 223
 0224            return CompressCore(source, destination, out bytesConsumed, out bytesWritten,
 0225                isFinalBlock ? Interop.Zstd.ZstdEndDirective.ZSTD_e_end : Interop.Zstd.ZstdEndDirective.ZSTD_e_continue)
 0226        }
 227
 228        /// <summary>Flushes any remaining processed data to the destination buffer.</summary>
 229        /// <param name="destination">The buffer to write the flushed data to.</param>
 230        /// <param name="bytesWritten">When this method returns, contains the number of bytes written to the destination
 231        /// <returns>An <see cref="OperationStatus"/> indicating the result of the operation.</returns>
 232        /// <exception cref="ObjectDisposedException">The encoder has been disposed.</exception>
 233        /// <exception cref="IOException">An error occurred during the operation.</exception>
 234        public OperationStatus Flush(Span<byte> destination, out int bytesWritten)
 0235        {
 0236            EnsureNotDisposed();
 237
 0238            return CompressCore(ReadOnlySpan<byte>.Empty, destination, out _, out bytesWritten,
 0239                Interop.Zstd.ZstdEndDirective.ZSTD_e_flush);
 0240        }
 241
 242        private OperationStatus CompressCore(ReadOnlySpan<byte> source, Span<byte> destination,
 243            out int bytesConsumed, out int bytesWritten, Interop.Zstd.ZstdEndDirective endDirective)
 0244        {
 0245            bytesConsumed = 0;
 0246            bytesWritten = 0;
 247
 248            unsafe
 0249            {
 0250                fixed (byte* inBytes = &MemoryMarshal.GetReference(source))
 0251                fixed (byte* outBytes = &MemoryMarshal.GetReference(destination))
 0252                {
 0253                    var input = new Interop.Zstd.ZstdInBuffer
 0254                    {
 0255                        src = inBytes,
 0256                        size = (nuint)source.Length,
 0257                        pos = 0
 0258                    };
 259
 0260                    var output = new Interop.Zstd.ZstdOutBuffer
 0261                    {
 0262                        dst = outBytes,
 0263                        size = (nuint)destination.Length,
 0264                        pos = 0
 0265                    };
 266
 0267                    nuint result = Interop.Zstd.ZSTD_compressStream2(_context, ref output, ref input, endDirective);
 268
 0269                    if (ZstandardUtils.IsError(result, out var error))
 0270                    {
 0271                        if (error == Interop.Zstd.ZSTD_error.srcSize_wrong)
 0272                        {
 0273                            return OperationStatus.InvalidData;
 274                        }
 275
 0276                        ZstandardUtils.Throw(error);
 277                    }
 278
 0279                    bytesConsumed = (int)input.pos;
 0280                    bytesWritten = (int)output.pos;
 281
 0282                    if (input.pos == input.size)
 0283                    {
 0284                        _finished |= endDirective == Interop.Zstd.ZstdEndDirective.ZSTD_e_end;
 285
 0286                        return result == 0 ? OperationStatus.Done : OperationStatus.DestinationTooSmall;
 287                    }
 288                    else
 0289                    {
 0290                        return OperationStatus.DestinationTooSmall;
 291                    }
 292                }
 293            }
 0294        }
 295
 296        /// <summary>Gets the maximum compressed size for the specified input length.</summary>
 297        /// <param name="inputLength">The length of the input data.</param>
 298        /// <returns>The maximum possible compressed size.</returns>
 299        /// <exception cref="ArgumentOutOfRangeException"><paramref name="inputLength"/> is less than 0.</exception>
 300        public static long GetMaxCompressedLength(long inputLength)
 0301        {
 0302            ArgumentOutOfRangeException.ThrowIfNegative(inputLength);
 0303            ArgumentOutOfRangeException.ThrowIfGreaterThan(inputLength, nint.MaxValue);
 304
 0305            nuint result = Interop.Zstd.ZSTD_compressBound((nuint)inputLength);
 0306            if (ZstandardUtils.IsError(result))
 0307            {
 0308                throw new ArgumentOutOfRangeException(nameof(inputLength));
 309            }
 310
 0311            if (result > long.MaxValue)
 0312            {
 0313                throw new ArgumentOutOfRangeException(nameof(inputLength));
 314            }
 315
 0316            return (long)result;
 0317        }
 318
 319        /// <summary>Attempts to compress the specified data.</summary>
 320        /// <param name="source">The data to compress.</param>
 321        /// <param name="destination">The buffer to write the compressed data to.</param>
 322        /// <param name="bytesWritten">When this method returns <see langword="true" />, contains the number of bytes wr
 323        /// <returns><see langword="true" /> on success; <see langword="false" /> if the destination buffer is too small
 324        public static bool TryCompress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten)
 0325        {
 0326            return TryCompress(source, destination, out bytesWritten, ZstandardUtils.Quality_Default, 0);
 0327        }
 328
 329        /// <summary>Attempts to compress the specified data with the specified quality and window size.</summary>
 330        /// <param name="source">The data to compress.</param>
 331        /// <param name="destination">The buffer to write the compressed data to.</param>
 332        /// <param name="bytesWritten">When this method returns <see langword="true" />, contains the number of bytes wr
 333        /// <param name="quality">The compression quality level.</param>
 334        /// <param name="windowLog2">The base-2 logarithm of the window size for compression.</param>
 335        /// <returns><see langword="true" /> on success; <see langword="false" /> if the destination buffer is too small
 336        /// <exception cref="ArgumentOutOfRangeException"><paramref name="quality"/> or <paramref name="windowLog2"/> is
 337        public static bool TryCompress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, int qual
 0338        {
 0339            return TryCompressCore(source, destination, out bytesWritten, quality, windowLog2, null);
 0340        }
 341
 342        /// <summary>Attempts to compress the specified data with the specified dictionary and window size.</summary>
 343        /// <param name="source">The data to compress.</param>
 344        /// <param name="destination">The buffer to write the compressed data to.</param>
 345        /// <param name="bytesWritten">When this method returns <see langword="true" />, contains the number of bytes wr
 346        /// <param name="dictionary">The compression dictionary to use.</param>
 347        /// <param name="windowLog2">The base-2 logarithm of the window size for compression.</param>
 348        /// <returns><see langword="true" /> on success; <see langword="false" /> if the destination buffer is too small
 349        /// <exception cref="ArgumentNullException"><paramref name="dictionary"/> is null.</exception>
 350        /// <exception cref="ArgumentOutOfRangeException"><paramref name="windowLog2"/> is out of the valid range.</exce
 351        public static bool TryCompress(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, Zstandar
 0352        {
 0353            ArgumentNullException.ThrowIfNull(dictionary);
 0354            return TryCompressCore(source, destination, out bytesWritten, 0, windowLog2, dictionary);
 0355        }
 356
 357        internal static bool TryCompressCore(ReadOnlySpan<byte> source, Span<byte> destination, out int bytesWritten, in
 0358        {
 0359            bytesWritten = 0;
 360
 0361            using SafeZstdCompressHandle ctx = Interop.Zstd.ZSTD_createCCtx();
 0362            if (ctx.IsInvalid)
 0363            {
 0364                throw new OutOfMemoryException();
 365            }
 366
 0367            if (dictionary != null)
 0368            {
 0369                ctx.SetDictionary(dictionary.CompressionDictionary);
 0370            }
 371            else
 0372            {
 0373                SetQuality(ctx, quality);
 0374            }
 375
 0376            if (windowLog2 != 0)
 0377            {
 0378                SetWindowLog(ctx, windowLog2);
 0379            }
 380
 381            unsafe
 0382            {
 0383                fixed (byte* inBytes = &MemoryMarshal.GetReference(source))
 0384                fixed (byte* outBytes = &MemoryMarshal.GetReference(destination))
 0385                {
 0386                    nuint result = Interop.Zstd.ZSTD_compress2(ctx, outBytes, (nuint)destination.Length, inBytes, (nuint
 387
 0388                    if (ZstandardUtils.IsError(result, out var error))
 0389                    {
 0390                        return false;
 391                    }
 392
 0393                    bytesWritten = (int)result;
 0394                    return true;
 395                }
 396            }
 0397        }
 398
 399        /// <summary>Resets the encoder session, allowing reuse for the next compression operation.</summary>
 400        /// <exception cref="ObjectDisposedException">The encoder has been disposed.</exception>
 401        /// <exception cref="IOException">Failed to reset the encoder session.</exception>
 402        public void Reset()
 0403        {
 0404            EnsureNotDisposed();
 405
 0406            _finished = false;
 0407            _context.Reset();
 0408        }
 409
 410        /// <summary>References a prefix for the next compression operation.</summary>
 411        /// <remarks>
 412        /// The prefix will be used only for the next compression frame and will be removed when <see cref="Reset"/> is 
 413        /// When compressing with a prefix larger than ~32 MB at high quality levels, set <see cref="ZstandardCompressio
 414        /// </remarks>
 415        /// <exception cref="ObjectDisposedException">The encoder has been disposed.</exception>
 416        /// <exception cref="InvalidOperationException">The encoder is in an invalid state for setting a prefix.</except
 417        public void SetPrefix(ReadOnlyMemory<byte> prefix)
 0418        {
 0419            EnsureNotDisposed();
 420
 0421            if (_finished)
 0422            {
 0423                throw new InvalidOperationException(SR.ZstandardEncoderDecoder_InvalidState);
 424            }
 425
 0426            nuint result = _context.SetPrefix(prefix);
 427
 0428            if (ZstandardUtils.IsError(result, out var error))
 0429            {
 0430                ZstandardUtils.Throw(error);
 431            }
 0432        }
 433
 434        /// <summary>Sets the length of the uncompressed data for the next compression operation.</summary>
 435        /// <param name="length">The length of the source data in bytes.</param>
 436        /// <remarks>
 437        /// Setting the source length is optional. If set, the information is stored in the header of the compressed dat
 438        /// Calling <see cref="Reset"/> clears the length. The length is validated during compression and if the value i
 439        /// the operation status is <see cref="OperationStatus.InvalidData"/>.
 440        /// </remarks>
 441        /// <exception cref="ArgumentOutOfRangeException"><paramref name="length"/> is negative.</exception>
 442        /// <exception cref="ObjectDisposedException">The encoder has been disposed.</exception>
 443        public void SetSourceLength(long length)
 0444        {
 0445            ArgumentOutOfRangeException.ThrowIfNegative(length);
 446
 0447            EnsureNotDisposed();
 448
 0449            if (_finished)
 0450            {
 0451                throw new InvalidOperationException(SR.ZstandardEncoderDecoder_InvalidState);
 452            }
 453
 0454            if (ZstandardUtils.IsError(Interop.Zstd.ZSTD_CCtx_setPledgedSrcSize(_context, (ulong)length), out var error)
 0455            {
 0456                ZstandardUtils.Throw(error);
 457            }
 0458        }
 459
 460        /// <summary>Releases all resources used by the <see cref="ZstandardEncoder"/>.</summary>
 461        public void Dispose()
 0462        {
 0463            _disposed = true;
 0464            _context.Dispose();
 0465        }
 466
 467        private void EnsureNotDisposed()
 0468        {
 0469            ObjectDisposedException.ThrowIf(_disposed, nameof(ZstandardEncoder));
 0470        }
 471
 472        internal static void SetQuality(SafeZstdCompressHandle handle, int quality)
 0473        {
 0474            if (quality != 0)
 0475            {
 0476                ArgumentOutOfRangeException.ThrowIfLessThan(quality, ZstandardUtils.Quality_Min, nameof(quality));
 0477                ArgumentOutOfRangeException.ThrowIfGreaterThan(quality, ZstandardUtils.Quality_Max, nameof(quality));
 0478            }
 479
 0480            SetParameter(handle, Interop.Zstd.ZstdCParameter.ZSTD_c_compressionLevel, quality);
 0481        }
 482
 483        internal static void SetWindowLog(SafeZstdCompressHandle handle, int windowLog2)
 0484        {
 0485            if (windowLog2 != 0)
 0486            {
 0487                ArgumentOutOfRangeException.ThrowIfLessThan(windowLog2, ZstandardUtils.WindowLog_Min, nameof(windowLog2)
 0488                ArgumentOutOfRangeException.ThrowIfGreaterThan(windowLog2, ZstandardUtils.WindowLog_Max, nameof(windowLo
 0489            }
 490
 0491            SetParameter(handle, Interop.Zstd.ZstdCParameter.ZSTD_c_windowLog, windowLog2);
 0492        }
 493
 494        internal void SetDictionary(ZstandardDictionary dictionary)
 0495        {
 0496            Debug.Assert(_context != null);
 0497            ArgumentNullException.ThrowIfNull(dictionary);
 498
 0499            _context.SetDictionary(dictionary.CompressionDictionary);
 0500        }
 501
 502        internal static void SetParameter(SafeZstdCompressHandle handle, Interop.Zstd.ZstdCParameter parameter, int valu
 0503        {
 0504            Debug.Assert(handle != null);
 505
 0506            nuint result = Interop.Zstd.ZSTD_CCtx_setParameter(handle, parameter, value);
 0507            ZstandardUtils.ThrowIfError(result);
 0508        }
 509    }
 510}
 511

Methods/Properties

.ctor()
.ctor(System.Int32)
.ctor(System.IO.Compression.ZstandardDictionary)
.ctor(System.Int32,System.Int32)
.ctor(System.IO.Compression.ZstandardDictionary,System.Int32)
.ctor(System.IO.Compression.ZstandardCompressionOptions)
InitializeEncoder()
Compress(System.ReadOnlySpan`1<System.Byte>,System.Span`1<System.Byte>,System.Int32&,System.Int32&,System.Boolean)
Flush(System.Span`1<System.Byte>,System.Int32&)
CompressCore(System.ReadOnlySpan`1<System.Byte>,System.Span`1<System.Byte>,System.Int32&,System.Int32&,Interop/Zstd/ZstdEndDirective)
GetMaxCompressedLength(System.Int64)
TryCompress(System.ReadOnlySpan`1<System.Byte>,System.Span`1<System.Byte>,System.Int32&)
TryCompress(System.ReadOnlySpan`1<System.Byte>,System.Span`1<System.Byte>,System.Int32&,System.Int32,System.Int32)
TryCompress(System.ReadOnlySpan`1<System.Byte>,System.Span`1<System.Byte>,System.Int32&,System.IO.Compression.ZstandardDictionary,System.Int32)
TryCompressCore(System.ReadOnlySpan`1<System.Byte>,System.Span`1<System.Byte>,System.Int32&,System.Int32,System.Int32,System.IO.Compression.ZstandardDictionary)
Reset()
SetPrefix(System.ReadOnlyMemory`1<System.Byte>)
SetSourceLength(System.Int64)
Dispose()
EnsureNotDisposed()
SetQuality(Microsoft.Win32.SafeHandles.SafeZstdCompressHandle,System.Int32)
SetWindowLog(Microsoft.Win32.SafeHandles.SafeZstdCompressHandle,System.Int32)
SetDictionary(System.IO.Compression.ZstandardDictionary)
SetParameter(Microsoft.Win32.SafeHandles.SafeZstdCompressHandle,Interop/Zstd/ZstdCParameter,System.Int32)