@@ -60,26 +60,46 @@ private static void SetWinDllDirectory()
60
60
[ DllImport ( DllName , CallingConvention = CallingConvention . Cdecl ) ]
61
61
public static extern size_t ZSTD_compressCCtx ( IntPtr ctx , IntPtr dst , size_t dstCapacity , IntPtr src , size_t srcSize , int compressionLevel ) ;
62
62
[ DllImport ( DllName , CallingConvention = CallingConvention . Cdecl ) ]
63
+ public static extern size_t ZSTD_compressCCtx ( IntPtr ctx , ref byte dst , size_t dstCapacity , ref byte src , size_t srcSize , int compressionLevel ) ;
64
+ public static size_t ZSTD_compressCCtx ( IntPtr ctx , Span < byte > dst , size_t dstCapacity , ReadOnlySpan < byte > src , size_t srcSize , int compressionLevel )
65
+ => ZSTD_compressCCtx ( ctx , ref MemoryMarshal . GetReference ( dst ) , dstCapacity , ref MemoryMarshal . GetReference ( src ) , srcSize , compressionLevel ) ;
66
+ [ DllImport ( DllName , CallingConvention = CallingConvention . Cdecl ) ]
63
67
public static extern size_t ZSTD_decompressDCtx ( IntPtr ctx , IntPtr dst , size_t dstCapacity , IntPtr src , size_t srcSize ) ;
68
+ [ DllImport ( DllName , CallingConvention = CallingConvention . Cdecl ) ]
69
+ public static extern size_t ZSTD_decompressDCtx ( IntPtr ctx , ref byte dst , size_t dstCapacity , ref byte src , size_t srcSize ) ;
70
+ public static size_t ZSTD_decompressDCtx ( IntPtr ctx , Span < byte > dst , size_t dstCapacity , ReadOnlySpan < byte > src , size_t srcSize )
71
+ => ZSTD_decompressDCtx ( ctx , ref MemoryMarshal . GetReference ( dst ) , dstCapacity , ref MemoryMarshal . GetReference ( src ) , srcSize ) ;
64
72
65
73
[ DllImport ( DllName , CallingConvention = CallingConvention . Cdecl ) ]
66
74
public static extern IntPtr ZSTD_createCDict ( byte [ ] dict , size_t dictSize , int compressionLevel ) ;
67
75
[ DllImport ( DllName , CallingConvention = CallingConvention . Cdecl ) ]
68
76
public static extern size_t ZSTD_freeCDict ( IntPtr cdict ) ;
69
77
[ DllImport ( DllName , CallingConvention = CallingConvention . Cdecl ) ]
70
78
public static extern size_t ZSTD_compress_usingCDict ( IntPtr cctx , IntPtr dst , size_t dstCapacity , IntPtr src , size_t srcSize , IntPtr cdict ) ;
79
+ [ DllImport ( DllName , CallingConvention = CallingConvention . Cdecl ) ]
80
+ public static extern size_t ZSTD_compress_usingCDict ( IntPtr cctx , ref byte dst , size_t dstCapacity , ref byte src , size_t srcSize , IntPtr cdict ) ;
81
+ public static size_t ZSTD_compress_usingCDict ( IntPtr cctx , Span < byte > dst , size_t dstCapacity , ReadOnlySpan < byte > src , size_t srcSize , IntPtr cdict )
82
+ => ZSTD_compress_usingCDict ( cctx , ref MemoryMarshal . GetReference ( dst ) , dstCapacity , ref MemoryMarshal . GetReference ( src ) , srcSize , cdict ) ;
71
83
72
84
[ DllImport ( DllName , CallingConvention = CallingConvention . Cdecl ) ]
73
85
public static extern IntPtr ZSTD_createDDict ( byte [ ] dict , size_t dictSize ) ;
74
86
[ DllImport ( DllName , CallingConvention = CallingConvention . Cdecl ) ]
75
87
public static extern size_t ZSTD_freeDDict ( IntPtr ddict ) ;
76
88
[ DllImport ( DllName , CallingConvention = CallingConvention . Cdecl ) ]
77
89
public static extern size_t ZSTD_decompress_usingDDict ( IntPtr dctx , IntPtr dst , size_t dstCapacity , IntPtr src , size_t srcSize , IntPtr ddict ) ;
90
+ [ DllImport ( DllName , CallingConvention = CallingConvention . Cdecl ) ]
91
+ public static extern size_t ZSTD_decompress_usingDDict ( IntPtr dctx , ref byte dst , size_t dstCapacity , ref byte src , size_t srcSize , IntPtr ddict ) ;
92
+ public static size_t ZSTD_decompress_usingDDict ( IntPtr dctx , Span < byte > dst , size_t dstCapacity , ReadOnlySpan < byte > src , size_t srcSize , IntPtr ddict )
93
+ => ZSTD_decompress_usingDDict ( dctx , ref MemoryMarshal . GetReference ( dst ) , dstCapacity , ref MemoryMarshal . GetReference ( src ) , srcSize , ddict ) ;
78
94
79
95
[ DllImport ( DllName , CallingConvention = CallingConvention . Cdecl ) ]
80
96
public static extern ulong ZSTD_getDecompressedSize ( IntPtr src , size_t srcSize ) ;
81
97
[ DllImport ( DllName , CallingConvention = CallingConvention . Cdecl ) ]
82
98
public static extern ulong ZSTD_getFrameContentSize ( IntPtr src , size_t srcSize ) ;
99
+ [ DllImport ( DllName , CallingConvention = CallingConvention . Cdecl ) ]
100
+ public static extern ulong ZSTD_getFrameContentSize ( ref byte src , size_t srcSize ) ;
101
+ public static ulong ZSTD_getFrameContentSize ( ReadOnlySpan < byte > src , size_t srcSize )
102
+ => ZSTD_getFrameContentSize ( ref MemoryMarshal . GetReference ( src ) , srcSize ) ;
83
103
84
104
public const ulong ZSTD_CONTENTSIZE_UNKNOWN = unchecked ( 0UL - 1 ) ;
85
105
public const ulong ZSTD_CONTENTSIZE_ERROR = unchecked ( 0UL - 2 ) ;
0 commit comments