94 references to Zstd
System.IO.Compression (94)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\LibraryImports.g.cs (22)
638
internal static partial nuint ZSTD_decompressStream(global::Microsoft.Win32.SafeHandles.SafeZstdDecompressHandle dctx, ref global::Interop.
Zstd
.ZstdOutBuffer output, ref global::Interop.
Zstd
.ZstdInBuffer input)
651
fixed (global::Interop.
Zstd
.ZstdInBuffer* __input_native = &input)
652
fixed (global::Interop.
Zstd
.ZstdOutBuffer* __output_native = &output)
667
static extern unsafe nuint __PInvoke(nint __dctx_native, global::Interop.
Zstd
.ZstdOutBuffer* __output_native, global::Interop.
Zstd
.ZstdInBuffer* __input_native);
677
internal static partial nuint ZSTD_DCtx_setParameter(global::Microsoft.Win32.SafeHandles.SafeZstdDecompressHandle dctx, global::Interop.
Zstd
.ZstdDParameter @param, int value)
703
static extern unsafe nuint __PInvoke(nint __dctx_native, global::Interop.
Zstd
.ZstdDParameter __param_native, int __value_native);
749
internal static partial nuint ZSTD_DCtx_reset(global::Microsoft.Win32.SafeHandles.SafeZstdDecompressHandle dctx, global::Interop.
Zstd
.ZstdResetDirective reset)
775
static extern unsafe nuint __PInvoke(nint __dctx_native, global::Interop.
Zstd
.ZstdResetDirective __reset_native);
785
internal 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)
798
fixed (global::Interop.
Zstd
.ZstdInBuffer* __input_native = &input)
799
fixed (global::Interop.
Zstd
.ZstdOutBuffer* __output_native = &output)
814
static 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);
824
internal static partial nuint ZSTD_CCtx_setParameter(global::Microsoft.Win32.SafeHandles.SafeZstdCompressHandle cctx, global::Interop.
Zstd
.ZstdCParameter @param, int value)
850
static extern unsafe nuint __PInvoke(nint __cctx_native, global::Interop.
Zstd
.ZstdCParameter __param_native, int __value_native);
896
internal static partial nuint ZSTD_CCtx_reset(global::Microsoft.Win32.SafeHandles.SafeZstdCompressHandle cctx, global::Interop.
Zstd
.ZstdResetDirective reset)
922
static extern unsafe nuint __PInvoke(nint __cctx_native, global::Interop.
Zstd
.ZstdResetDirective __reset_native);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeZstdHandle.cs (18)
20
Interop.
Zstd
.ZSTD_freeCCtx(handle);
42
ZstandardUtils.ThrowIfError(Interop.
Zstd
.ZSTD_CCtx_refCDict(this, dictionary));
57
nuint result = Interop.
Zstd
.ZSTD_CCtx_refPrefix(this, (byte*)handle.Pointer, (nuint)prefix.Length);
59
if (Interop.
Zstd
.ZSTD_isError(result) != 0)
74
ZstandardUtils.ThrowIfError(Interop.
Zstd
.ZSTD_CCtx_reset(this, Interop.
Zstd
.ZstdResetDirective.ZSTD_reset_session_only));
80
? Interop.
Zstd
.ZSTD_CCtx_refCDict(this, _dictionary)
81
: Interop.
Zstd
.ZSTD_CCtx_refPrefix(this, null, 0);
99
Interop.
Zstd
.ZSTD_freeDCtx(handle);
121
ZstandardUtils.ThrowIfError(Interop.
Zstd
.ZSTD_DCtx_refDDict(this, dictionary));
136
nuint result = Interop.
Zstd
.ZSTD_DCtx_refPrefix(this, (byte*)handle.Pointer, (nuint)prefix.Length);
138
if (Interop.
Zstd
.ZSTD_isError(result) != 0)
153
ZstandardUtils.ThrowIfError(Interop.
Zstd
.ZSTD_DCtx_reset(this, Interop.
Zstd
.ZstdResetDirective.ZSTD_reset_session_only));
159
? Interop.
Zstd
.ZSTD_DCtx_refDDict(this, _dictionary)
160
: Interop.
Zstd
.ZSTD_DCtx_refPrefix(this, null, 0);
178
Interop.
Zstd
.ZSTD_freeCDict(handle);
194
Interop.
Zstd
.ZSTD_freeDDict(handle);
System\IO\Compression\Zstandard\ZstandardDecoder.cs (12)
145
_context = Interop.
Zstd
.ZSTD_createDCtx();
190
var input = new Interop.
Zstd
.ZstdInBuffer
197
var output = new Interop.
Zstd
.ZstdOutBuffer
204
nuint result = Interop.
Zstd
.ZSTD_decompressStream(_context, ref output, ref input);
212
case Interop.
Zstd
.ZSTD_error.frameParameter_windowTooLarge:
213
case Interop.
Zstd
.ZSTD_error.dictionary_wrong:
258
ulong frameContentSize = Interop.
Zstd
.ZSTD_decompressBound(dataPtr, (nuint)data.Length);
294
nuint result = Interop.
Zstd
.ZSTD_decompress(
328
using var dctx = Interop.
Zstd
.ZSTD_createDCtx();
339
nuint result = Interop.
Zstd
.ZSTD_decompress_usingDDict(
413
nuint result = Interop.
Zstd
.ZSTD_DCtx_setParameter(_context, Interop.
Zstd
.ZstdDParameter.ZSTD_d_windowLogMax, maxWindowLog2);
System\IO\Compression\Zstandard\ZstandardDictionary.cs (4)
54
SafeZstdCDictHandle compressionDict = Interop.
Zstd
.ZSTD_createCDict_byReference(dictPtr, (nuint)data.Length, quality);
62
SafeZstdDDictHandle decompressionDict = Interop.
Zstd
.ZSTD_createDDict_byReference(dictPtr, (nuint)data.Length);
152
ZstandardUtils.Throw(Interop.
Zstd
.ZSTD_error.srcSize_wrong);
164
dictSize = Interop.
Zstd
.ZDICT_trainFromBuffer(
System\IO\Compression\Zstandard\ZstandardEncoder.cs (23)
162
SetParameter(_context, Interop.
Zstd
.ZstdCParameter.ZSTD_c_checksumFlag, 1);
167
SetParameter(_context, Interop.
Zstd
.ZstdCParameter.ZSTD_c_enableLongDistanceMatching, 1);
172
SetParameter(_context, Interop.
Zstd
.ZstdCParameter.ZSTD_c_targetCBlockSize, compressionOptions.TargetBlockSize);
177
SetParameter(_context, Interop.
Zstd
.ZstdCParameter.ZSTD_c_hashLog, compressionOptions.HashLog2);
182
SetParameter(_context, Interop.
Zstd
.ZstdCParameter.ZSTD_c_chainLog, compressionOptions.ChainLog2);
195
_context = Interop.
Zstd
.ZSTD_createCCtx();
224
isFinalBlock ? Interop.
Zstd
.ZstdEndDirective.ZSTD_e_end : Interop.
Zstd
.ZstdEndDirective.ZSTD_e_continue);
238
Interop.
Zstd
.ZstdEndDirective.ZSTD_e_flush);
242
out int bytesConsumed, out int bytesWritten, Interop.
Zstd
.ZstdEndDirective endDirective)
252
var input = new Interop.
Zstd
.ZstdInBuffer
259
var output = new Interop.
Zstd
.ZstdOutBuffer
266
nuint result = Interop.
Zstd
.ZSTD_compressStream2(_context, ref output, ref input, endDirective);
270
if (error == Interop.
Zstd
.ZSTD_error.srcSize_wrong)
283
_finished |= endDirective == Interop.
Zstd
.ZstdEndDirective.ZSTD_e_end;
304
nuint result = Interop.
Zstd
.ZSTD_compressBound((nuint)inputLength);
360
using SafeZstdCompressHandle ctx = Interop.
Zstd
.ZSTD_createCCtx();
385
nuint result = Interop.
Zstd
.ZSTD_compress2(ctx, outBytes, (nuint)destination.Length, inBytes, (nuint)source.Length);
456
if (ZstandardUtils.IsError(Interop.
Zstd
.ZSTD_CCtx_setPledgedSrcSize(_context, (ulong)length), out var error))
482
SetParameter(handle, Interop.
Zstd
.ZstdCParameter.ZSTD_c_compressionLevel, quality);
493
SetParameter(handle, Interop.
Zstd
.ZstdCParameter.ZSTD_c_windowLog, windowLog2);
504
internal static void SetParameter(SafeZstdCompressHandle handle, Interop.
Zstd
.ZstdCParameter parameter, int value)
508
nuint result = Interop.
Zstd
.ZSTD_CCtx_setParameter(handle, parameter, value);
System\IO\Compression\Zstandard\ZstandardUtils.cs (15)
12
internal static readonly int Quality_Min = Interop.
Zstd
.ZSTD_minCLevel();
13
internal static readonly int Quality_Max = Interop.
Zstd
.ZSTD_maxCLevel();
14
internal static readonly int Quality_Default = Interop.
Zstd
.ZSTD_defaultCLevel();
35
internal static bool IsError(nuint result) => Interop.
Zstd
.ZSTD_isError(result) != 0;
36
internal static bool IsError(nuint result, out Interop.
Zstd
.ZSTD_error error)
40
error = (Interop.
Zstd
.ZSTD_error)result;
44
error = Interop.
Zstd
.ZSTD_error.no_error;
49
internal static string GetErrorMessage(Interop.
Zstd
.ZSTD_error error)
51
IntPtr errorNamePtr = Interop.
Zstd
.ZSTD_getErrorName((nuint)error);
64
internal static void Throw(Interop.
Zstd
.ZSTD_error error)
70
internal static Exception CreateExceptionForError(Interop.
Zstd
.ZSTD_error error)
76
case Interop.
Zstd
.ZSTD_error.frameParameter_windowTooLarge:
79
case Interop.
Zstd
.ZSTD_error.dictionary_wrong:
82
case Interop.
Zstd
.ZSTD_error.memory_allocation:
85
case Interop.
Zstd
.ZSTD_error.stage_wrong: