Replace ZstdNet with ZstdSharp.Port.

This commit is contained in:
Ahmed Yasin Koculu
2026-06-13 06:57:38 +02:00
parent 40baa619ea
commit b241d94fc6
2 changed files with 4 additions and 5 deletions
@@ -1,4 +1,4 @@
using ZstdNet;
using ZstdSharp;
namespace ZoneTree.Compression;
@@ -6,8 +6,7 @@ public static class ZstdDataCompression
{
public static Memory<byte> Compress(Memory<byte> bytes, int level)
{
using var options = new CompressionOptions(level);
using var compressor = new Compressor(options);
using var compressor = new Compressor(level);
return compressor.Wrap(bytes.Span).ToArray();
}
@@ -21,7 +20,7 @@ public static class ZstdDataCompression
{
var decompressed = new byte[decompressedLength];
using var decompressor = new Decompressor();
decompressor.Unwrap(compressedBytes.Span, decompressed, 0);
decompressor.Unwrap(compressedBytes.Span, decompressed.AsSpan());
return decompressed;
}
}
+1 -1
View File
@@ -46,6 +46,6 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="ZstdNet" Version="1.5.7" />
<PackageReference Include="ZstdSharp.Port" Version="0.8.8" />
</ItemGroup>
</Project>