mirror of
https://github.com/ZoneTree/ZoneTree.git
synced 2026-10-16 21:13:40 +08:00
Remove unused decompress methods.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using System.IO.Compression;
|
||||
using ZoneTree.AbstractFileStream;
|
||||
|
||||
namespace ZoneTree.Compression;
|
||||
|
||||
@@ -22,17 +21,6 @@ public static class BrotliDataCompression
|
||||
return compressed.AsMemory(0, compressedLength);
|
||||
}
|
||||
|
||||
public static byte[] Decompress(Memory<byte> compressedBytes)
|
||||
{
|
||||
using var pin = compressedBytes.Pin();
|
||||
using var msInput = compressedBytes.ToReadOnlyStream(pin);
|
||||
using var msOutput = new MemoryStream();
|
||||
using var gzs = new BrotliStream(msInput, CompressionMode.Decompress);
|
||||
gzs.CopyTo(msOutput);
|
||||
var decompressed = msOutput.ToArray();
|
||||
return decompressed;
|
||||
}
|
||||
|
||||
public static byte[] Decompress(Memory<byte> compressedBytes, int decompressedLength)
|
||||
{
|
||||
var decompressed = new byte[decompressedLength];
|
||||
|
||||
@@ -15,17 +15,6 @@ public static class GZipDataCompression
|
||||
return msOutput.ToArray();
|
||||
}
|
||||
|
||||
public static byte[] Decompress(Memory<byte> compressedBytes)
|
||||
{
|
||||
using var pin = compressedBytes.Pin();
|
||||
using var msInput = compressedBytes.ToReadOnlyStream(pin);
|
||||
using var msOutput = new MemoryStream(compressedBytes.Length);
|
||||
using var gzs = new GZipStream(msInput, CompressionMode.Decompress);
|
||||
gzs.CopyTo(msOutput);
|
||||
var decompressed = msOutput.ToArray();
|
||||
return decompressed;
|
||||
}
|
||||
|
||||
public static byte[] Decompress(Memory<byte> compressedBytes, int decompressedLength)
|
||||
{
|
||||
var decompressed = new byte[decompressedLength];
|
||||
|
||||
@@ -9,11 +9,6 @@ public static class LZ4DataCompression
|
||||
return LZ4Pickler.Pickle(bytes.Span, (LZ4Level)level);
|
||||
}
|
||||
|
||||
public static byte[] Decompress(Memory<byte> compressedBytes)
|
||||
{
|
||||
return LZ4Pickler.Unpickle(compressedBytes.Span);
|
||||
}
|
||||
|
||||
public static byte[] Decompress(Memory<byte> compressedBytes, int decompressedLength)
|
||||
{
|
||||
var bytes = new byte[decompressedLength];
|
||||
@@ -23,6 +18,6 @@ public static class LZ4DataCompression
|
||||
|
||||
public static int GetDecompressedLength(Memory<byte> compressedBytes)
|
||||
{
|
||||
return checked((int)LZ4Pickler.UnpickledSize(compressedBytes.Span));
|
||||
return checked(LZ4Pickler.UnpickledSize(compressedBytes.Span));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,13 +18,6 @@ public static class ZstdDataCompression
|
||||
return compressed.AsMemory(0, compressedLength);
|
||||
}
|
||||
|
||||
public static byte[] Decompress(Memory<byte> compressedBytes)
|
||||
{
|
||||
var decompressedLength = checked((int)Decompressor
|
||||
.GetDecompressedSize(compressedBytes.Span));
|
||||
return Decompress(compressedBytes, decompressedLength);
|
||||
}
|
||||
|
||||
public static byte[] Decompress(Memory<byte> compressedBytes, int decompressedLength)
|
||||
{
|
||||
var decompressed = new byte[decompressedLength];
|
||||
|
||||
Reference in New Issue
Block a user