Пример #1
0
 public static UIntPtr ResetDCtx(DCtx *dCtx, ResetDirective reset)
 {
     IL.Push(dCtx);
     IL.Push(reset);
     IL.Push(ZSTD_DCtx_reset);
     IL.Emit.Tail();
     IL.Emit.Calli(new StandAloneMethodSig(CallingConvention.Cdecl, typeof(UIntPtr),
                                           typeof(DCtx *), typeof(ResetDirective)));
     return(IL.Return <UIntPtr>());
 }
Пример #2
0
 private static UIntPtr ReferenceDictionary(DCtx *dCtx, byte *dict, UIntPtr dictSize)
 {
     IL.Push(dCtx);
     IL.Push(dict);
     IL.Push(dictSize);
     IL.Push(ZSTD_DCtx_loadDictionary_byReference);
     IL.Emit.Tail();
     IL.Emit.Calli(new StandAloneMethodSig(CallingConvention.Cdecl, typeof(UIntPtr),
                                           typeof(DCtx *), typeof(byte *), typeof(UIntPtr)));
     return(IL.Return <UIntPtr>());
 }
Пример #3
0
 public static UIntPtr StreamDecompress(DCtx *ctx, ref Buffer output, ref Buffer input)
 {
     IL.Push(ctx);
     IL.Push(ref output);
     IL.Push(ref input);
     IL.Push(ZSTD_decompressStream);
     IL.Emit.Tail();
     IL.Emit.Calli(new StandAloneMethodSig(CallingConvention.Cdecl, typeof(UIntPtr),
                                           typeof(DCtx).MakeByRefType(), typeof(Buffer).MakeByRefType(), typeof(Buffer).MakeByRefType()));
     return(IL.Return <UIntPtr>());
 }
Пример #4
0
 public static UIntPtr SetParameter(DCtx *dCtx, DecompressionParameter parameter, int value)
 {
     IL.Push(dCtx);
     IL.Push(parameter);
     IL.Push(value);
     IL.Push(ZSTD_DCtx_setParameter);
     IL.Emit.Tail();
     IL.Emit.Calli(new StandAloneMethodSig(CallingConvention.Cdecl, typeof(UIntPtr),
                                           typeof(CCtx *), typeof(DecompressionParameter), typeof(int)));
     return(IL.Return <UIntPtr>());
 }
Пример #5
0
 private static UIntPtr InsertBlock(DCtx *ctx, byte *src, UIntPtr srcSize)
 {
     IL.Push(ctx);
     IL.Push(src);
     IL.Push(srcSize);
     IL.Push(ZSTD_insertBlock);
     IL.Emit.Tail();
     IL.Emit.Calli(new StandAloneMethodSig(CallingConvention.Cdecl, typeof(UIntPtr),
                                           typeof(CCtx *), typeof(byte *), typeof(UIntPtr)));
     return(IL.Return <UIntPtr>());
 }
Пример #6
0
 private static UIntPtr Decompress(DCtx *ctx, byte *dst, UIntPtr dstCapacity, byte *src, UIntPtr srcSize)
 {
     IL.Push(ctx);
     IL.Push(dst);
     IL.Push(dstCapacity);
     IL.Push(src);
     IL.Push(srcSize);
     IL.Push(ZSTD_decompressDCtx);
     IL.Emit.Tail();
     IL.Emit.Calli(new StandAloneMethodSig(CallingConvention.Cdecl, typeof(UIntPtr),
                                           typeof(DCtx *), typeof(byte *), typeof(UIntPtr), typeof(byte *), typeof(UIntPtr)));
     return(IL.Return <UIntPtr>());
 }
Пример #7
0
 public static UIntPtr ReferenceDictionary(DCtx *cCtx, ReadOnlySpan <byte> dict) {
     fixed(byte *pDict = dict)
     return(ReferenceDictionary(cCtx, pDict, (UIntPtr)dict.Length));
 }
Пример #8
0
 public static UIntPtr ResetDictionary(DCtx *cDtx)
 => ReferenceDictionary(cDtx, default(DDict *));
Пример #9
0
 public static UIntPtr Decompress(DCtx *ctx, Span <byte> dst, ReadOnlySpan <byte> src) {
     fixed(byte *pDst = dst)
     fixed(byte *pSrc = src)
     return(Decompress(ctx, pDst, (UIntPtr)dst.Length, pSrc, (UIntPtr)src.Length));
 }