90 references to Zstd
System.IO.Compression (90)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\LibraryImports.g.cs (22)
638internal static partial nuint ZSTD_decompressStream(global::Microsoft.Win32.SafeHandles.SafeZstdDecompressHandle dctx, ref global::Interop.Zstd.ZstdOutBuffer output, ref global::Interop.Zstd.ZstdInBuffer input) 651fixed (global::Interop.Zstd.ZstdInBuffer* __input_native = &input) 652fixed (global::Interop.Zstd.ZstdOutBuffer* __output_native = &output) 667static extern unsafe nuint __PInvoke(nint __dctx_native, global::Interop.Zstd.ZstdOutBuffer* __output_native, global::Interop.Zstd.ZstdInBuffer* __input_native); 677internal static partial nuint ZSTD_DCtx_setParameter(global::Microsoft.Win32.SafeHandles.SafeZstdDecompressHandle dctx, global::Interop.Zstd.ZstdDParameter @param, int value) 703static extern unsafe nuint __PInvoke(nint __dctx_native, global::Interop.Zstd.ZstdDParameter __param_native, int __value_native); 749internal static partial nuint ZSTD_DCtx_reset(global::Microsoft.Win32.SafeHandles.SafeZstdDecompressHandle dctx, global::Interop.Zstd.ZstdResetDirective reset) 775static extern unsafe nuint __PInvoke(nint __dctx_native, global::Interop.Zstd.ZstdResetDirective __reset_native); 785internal static partial nuint ZSTD_compressStream2(global::Microsoft.Win32.SafeHandles.SafeZstdCompressHandle cctx, ref global::Interop.Zstd.ZstdOutBuffer output, ref global::Interop.Zstd.ZstdInBuffer input, global::Interop.Zstd.ZstdEndDirective endOp) 798fixed (global::Interop.Zstd.ZstdInBuffer* __input_native = &input) 799fixed (global::Interop.Zstd.ZstdOutBuffer* __output_native = &output) 814static extern unsafe nuint __PInvoke(nint __cctx_native, global::Interop.Zstd.ZstdOutBuffer* __output_native, global::Interop.Zstd.ZstdInBuffer* __input_native, global::Interop.Zstd.ZstdEndDirective __endOp_native); 824internal static partial nuint ZSTD_CCtx_setParameter(global::Microsoft.Win32.SafeHandles.SafeZstdCompressHandle cctx, global::Interop.Zstd.ZstdCParameter @param, int value) 850static extern unsafe nuint __PInvoke(nint __cctx_native, global::Interop.Zstd.ZstdCParameter __param_native, int __value_native); 896internal static partial nuint ZSTD_CCtx_reset(global::Microsoft.Win32.SafeHandles.SafeZstdCompressHandle cctx, global::Interop.Zstd.ZstdResetDirective reset) 922static extern unsafe nuint __PInvoke(nint __cctx_native, global::Interop.Zstd.ZstdResetDirective __reset_native);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeZstdHandle.cs (14)
20Interop.Zstd.ZSTD_freeCCtx(handle); 42ZstandardUtils.ThrowIfError(Interop.Zstd.ZSTD_CCtx_refCDict(this, dictionary)); 57nuint result = Interop.Zstd.ZSTD_CCtx_refPrefix(this, (byte*)handle.Pointer, (nuint)prefix.Length); 59if (Interop.Zstd.ZSTD_isError(result) != 0) 74ZstandardUtils.ThrowIfError(Interop.Zstd.ZSTD_CCtx_reset(this, Interop.Zstd.ZstdResetDirective.ZSTD_reset_session_only)); 95Interop.Zstd.ZSTD_freeDCtx(handle); 117ZstandardUtils.ThrowIfError(Interop.Zstd.ZSTD_DCtx_refDDict(this, dictionary)); 132nuint result = Interop.Zstd.ZSTD_DCtx_refPrefix(this, (byte*)handle.Pointer, (nuint)prefix.Length); 134if (Interop.Zstd.ZSTD_isError(result) != 0) 149ZstandardUtils.ThrowIfError(Interop.Zstd.ZSTD_DCtx_reset(this, Interop.Zstd.ZstdResetDirective.ZSTD_reset_session_only)); 170Interop.Zstd.ZSTD_freeCDict(handle); 186Interop.Zstd.ZSTD_freeDDict(handle);
System\IO\Compression\Zstandard\ZstandardDecoder.cs (12)
146_context = Interop.Zstd.ZSTD_createDCtx(); 191var input = new Interop.Zstd.ZstdInBuffer 198var output = new Interop.Zstd.ZstdOutBuffer 205nuint result = Interop.Zstd.ZSTD_decompressStream(_context, ref output, ref input); 213case Interop.Zstd.ZSTD_error.frameParameter_windowTooLarge: 214case Interop.Zstd.ZSTD_error.dictionary_wrong: 259ulong frameContentSize = Interop.Zstd.ZSTD_decompressBound(dataPtr, (nuint)data.Length); 295nuint result = Interop.Zstd.ZSTD_decompress( 329using var dctx = Interop.Zstd.ZSTD_createDCtx(); 340nuint result = Interop.Zstd.ZSTD_decompress_usingDDict( 409nuint result = Interop.Zstd.ZSTD_DCtx_setParameter(_context, Interop.Zstd.ZstdDParameter.ZSTD_d_windowLogMax, maxWindowLog2);
System\IO\Compression\Zstandard\ZstandardDictionary.cs (4)
55SafeZstdCDictHandle compressionDict = Interop.Zstd.ZSTD_createCDict_byReference(dictPtr, (nuint)data.Length, quality); 63SafeZstdDDictHandle decompressionDict = Interop.Zstd.ZSTD_createDDict_byReference(dictPtr, (nuint)data.Length); 143ZstandardUtils.Throw(Interop.Zstd.ZSTD_error.srcSize_wrong); 155dictSize = Interop.Zstd.ZDICT_trainFromBuffer(
System\IO\Compression\Zstandard\ZstandardEncoder.cs (23)
163SetParameter(_context, Interop.Zstd.ZstdCParameter.ZSTD_c_checksumFlag, 1); 168SetParameter(_context, Interop.Zstd.ZstdCParameter.ZSTD_c_enableLongDistanceMatching, 1); 173SetParameter(_context, Interop.Zstd.ZstdCParameter.ZSTD_c_targetCBlockSize, compressionOptions.TargetBlockSize); 178SetParameter(_context, Interop.Zstd.ZstdCParameter.ZSTD_c_hashLog, compressionOptions.HashLog2); 183SetParameter(_context, Interop.Zstd.ZstdCParameter.ZSTD_c_chainLog, compressionOptions.ChainLog2); 196_context = Interop.Zstd.ZSTD_createCCtx(); 225isFinalBlock ? Interop.Zstd.ZstdEndDirective.ZSTD_e_end : Interop.Zstd.ZstdEndDirective.ZSTD_e_continue); 239Interop.Zstd.ZstdEndDirective.ZSTD_e_flush); 243out int bytesConsumed, out int bytesWritten, Interop.Zstd.ZstdEndDirective endDirective) 253var input = new Interop.Zstd.ZstdInBuffer 260var output = new Interop.Zstd.ZstdOutBuffer 267nuint result = Interop.Zstd.ZSTD_compressStream2(_context, ref output, ref input, endDirective); 271if (error == Interop.Zstd.ZSTD_error.srcSize_wrong) 284_finished |= endDirective == Interop.Zstd.ZstdEndDirective.ZSTD_e_end; 305nuint result = Interop.Zstd.ZSTD_compressBound((nuint)inputLength); 361using SafeZstdCompressHandle ctx = Interop.Zstd.ZSTD_createCCtx(); 386nuint result = Interop.Zstd.ZSTD_compress2(ctx, outBytes, (nuint)destination.Length, inBytes, (nuint)source.Length); 454if (ZstandardUtils.IsError(Interop.Zstd.ZSTD_CCtx_setPledgedSrcSize(_context, (ulong)length), out var error)) 480SetParameter(handle, Interop.Zstd.ZstdCParameter.ZSTD_c_compressionLevel, quality); 491SetParameter(handle, Interop.Zstd.ZstdCParameter.ZSTD_c_windowLog, windowLog2); 502internal static void SetParameter(SafeZstdCompressHandle handle, Interop.Zstd.ZstdCParameter parameter, int value) 506nuint result = Interop.Zstd.ZSTD_CCtx_setParameter(handle, parameter, value);
System\IO\Compression\Zstandard\ZstandardUtils.cs (15)
12internal static readonly int Quality_Min = Interop.Zstd.ZSTD_minCLevel(); 13internal static readonly int Quality_Max = Interop.Zstd.ZSTD_maxCLevel(); 14internal static readonly int Quality_Default = Interop.Zstd.ZSTD_defaultCLevel(); 35internal static bool IsError(nuint result) => Interop.Zstd.ZSTD_isError(result) != 0; 36internal static bool IsError(nuint result, out Interop.Zstd.ZSTD_error error) 40error = (Interop.Zstd.ZSTD_error)result; 44error = Interop.Zstd.ZSTD_error.no_error; 49internal static string GetErrorMessage(Interop.Zstd.ZSTD_error error) 51IntPtr errorNamePtr = Interop.Zstd.ZSTD_getErrorName((nuint)error); 64internal static void Throw(Interop.Zstd.ZSTD_error error) 70internal static Exception CreateExceptionForError(Interop.Zstd.ZSTD_error error) 76case Interop.Zstd.ZSTD_error.frameParameter_windowTooLarge: 79case Interop.Zstd.ZSTD_error.dictionary_wrong: 82case Interop.Zstd.ZSTD_error.memory_allocation: 85case Interop.Zstd.ZSTD_error.stage_wrong: