示例#1
0
        public int Wrap(ReadOnlySpan <byte> src, Span <byte> dst)
        {
            var dstSize = Options.AdvancedParams != null
                                ? ExternMethods.ZSTD_compress2(cctx, dst, (size_t)dst.Length, src, (size_t)src.Length)
                                : Options.Cdict == IntPtr.Zero
                                        ? ExternMethods.ZSTD_compressCCtx(cctx, dst, (size_t)dst.Length, src, (size_t)src.Length, Options.CompressionLevel)
                                        : ExternMethods.ZSTD_compress_usingCDict(cctx, dst, (size_t)dst.Length, src, (size_t)src.Length, Options.Cdict);

            return((int)dstSize.EnsureZstdSuccess());
        }