From 5d91bcee42f5a702685f7092321dd204ba38306e Mon Sep 17 00:00:00 2001 From: Mutudu Date: Sun, 26 Nov 2023 15:01:19 +0800 Subject: [PATCH] Format codes --- perf/Benchmark/Benchmarks/CompressToBytes.cs | 2 +- perf/Benchmark/Benchmarks/CompressToStream.cs | 2 +- .../Benchmarks/DecompressFromBytes.cs | 2 +- .../Benchmarks/DecompressFromStream.cs | 13 ++++-- perf/Benchmark/Consts.cs | 2 +- perf/Benchmark/GlobalUsings.cs | 2 +- perf/Benchmark/Program.cs | 2 +- src/Zaabee.Brotli/Brotli.Extensions.Bytes.cs | 6 +-- .../Brotli.Extensions.Stream.Async.cs | 18 ++++---- src/Zaabee.Brotli/Brotli.Extensions.Stream.cs | 14 +++---- src/Zaabee.Brotli/Brotli.Extensions.String.cs | 10 ++--- src/Zaabee.Brotli/Brotli.Helper.Bytes.cs | 7 +--- .../Brotli.Helper.Stream.Async.cs | 22 ++++++---- src/Zaabee.Brotli/Brotli.Helper.Stream.cs | 15 ++++--- src/Zaabee.Brotli/Brotli.Helper.String.cs | 13 +++--- src/Zaabee.Brotli/Brotli.Helper.cs | 2 +- src/Zaabee.Brotli/BrotliCompressor.cs | 42 +++++++------------ src/Zaabee.Brotli/GlobalUsings.cs | 2 +- src/Zaabee.Compressor.Abstractions/Consts.cs | 2 +- .../GlobalUsings.cs | 2 +- .../ICompressor.Bytes.cs | 17 +++++--- .../ICompressor.Stream.Async.cs | 24 ++++++++--- .../ICompressor.Stream.cs | 2 +- .../NullCompressor.cs | 33 +++++++++------ src/Zaabee.LZ4/GlobalUsings.cs | 2 +- src/Zaabee.LZ4/LZ4.Extensions.Bytes.cs | 10 ++--- src/Zaabee.LZ4/LZ4.Extensions.Stream.Async.cs | 25 +++++++---- src/Zaabee.LZ4/LZ4.Extensions.Stream.cs | 18 ++++---- src/Zaabee.LZ4/LZ4.Extensions.String.cs | 10 ++--- src/Zaabee.LZ4/LZ4.Helper.Bytes.cs | 8 ++-- src/Zaabee.LZ4/LZ4.Helper.Stream.Async.cs | 14 ++++--- src/Zaabee.LZ4/LZ4.Helper.Stream.cs | 14 ++++--- src/Zaabee.LZ4/LZ4.Helper.String.cs | 9 ++-- src/Zaabee.LZ4/LZ4.Helper.cs | 2 +- src/Zaabee.LZ4/Lz4Compressor.cs | 35 +++++++--------- src/Zaabee.LZMA/GlobalUsings.cs | 2 +- src/Zaabee.LZMA/LZMA.Extensions.Bytes.cs | 9 ++-- .../LZMA.Extensions.Stream.Async.cs | 18 ++++---- src/Zaabee.LZMA/LZMA.Extensions.Stream.cs | 17 +++----- src/Zaabee.LZMA/LZMA.Extensions.String.cs | 10 ++--- src/Zaabee.LZMA/LZMA.Helper.Bytes.cs | 8 ++-- src/Zaabee.LZMA/LZMA.Helper.Stream.Async.cs | 21 +++++++--- src/Zaabee.LZMA/LZMA.Helper.Stream.cs | 16 +++---- src/Zaabee.LZMA/LZMA.Helper.String.cs | 10 ++--- src/Zaabee.LZMA/LzmaCompressor.cs | 38 +++++++---------- .../BZip2.Extensions.Bytes.cs | 5 +-- .../BZip2.Extensions.Stream.Async.cs | 18 ++++---- .../BZip2.Extensions.Stream.cs | 13 ++---- .../BZip2.Extensions.String.cs | 10 ++--- src/Zaabee.SharpZipLib/BZip2.Helper.Bytes.cs | 2 +- .../BZip2.Helper.Stream.Async.cs | 14 ++++--- src/Zaabee.SharpZipLib/BZip2.Helper.Stream.cs | 16 +++---- src/Zaabee.SharpZipLib/BZip2.Helper.String.cs | 10 ++--- src/Zaabee.SharpZipLib/Bzip2Compressor.cs | 38 +++++++---------- .../GZip.Extensions.Bytes.cs | 5 +-- .../GZip.Extensions.Stream.Async.cs | 18 ++++---- .../GZip.Extensions.Stream.cs | 13 ++---- .../GZip.Extensions.String.cs | 10 ++--- src/Zaabee.SharpZipLib/GZip.Helper.Bytes.cs | 2 +- .../GZip.Helper.Stream.Async.cs | 14 ++++--- src/Zaabee.SharpZipLib/GZip.Helper.Stream.cs | 16 +++---- src/Zaabee.SharpZipLib/GZip.Helper.String.cs | 10 ++--- src/Zaabee.SharpZipLib/GlobalUsings.cs | 2 +- src/Zaabee.SharpZipLib/GzipCompressor.cs | 38 +++++++---------- src/Zaabee.Snappy/GlobalUsings.cs | 2 +- src/Zaabee.Snappy/Snappy.Extensions.Bytes.cs | 9 ++-- .../Snappy.Extensions.Stream.Async.cs | 18 ++++---- src/Zaabee.Snappy/Snappy.Extensions.Stream.cs | 17 +++----- src/Zaabee.Snappy/Snappy.Extensions.String.cs | 10 ++--- src/Zaabee.Snappy/Snappy.Helper.Bytes.cs | 9 ++-- .../Snappy.Helper.Stream.Async.cs | 21 +++++++--- src/Zaabee.Snappy/Snappy.Helper.Stream.cs | 16 +++---- src/Zaabee.Snappy/Snappy.Helper.String.cs | 13 ++---- src/Zaabee.Snappy/SnappyCompressor.cs | 38 +++++++---------- src/Zaabee.XZ/GlobalUsings.cs | 2 +- src/Zaabee.XZ/XZ.Extensions.Bytes.cs | 10 ++--- src/Zaabee.XZ/XZ.Extensions.Stream.Async.cs | 18 ++++---- src/Zaabee.XZ/XZ.Extensions.Stream.cs | 17 ++++---- src/Zaabee.XZ/XZ.Extensions.String.cs | 10 ++--- src/Zaabee.XZ/XZ.Helper.Bytes.cs | 8 ++-- src/Zaabee.XZ/XZ.Helper.Stream.Async.cs | 14 ++++--- src/Zaabee.XZ/XZ.Helper.Stream.cs | 15 ++++--- src/Zaabee.XZ/XZ.Helper.String.cs | 10 ++--- src/Zaabee.XZ/XZ.Helper.cs | 2 +- src/Zaabee.XZ/XzCompressor.cs | 42 +++++++------------ src/Zaabee.Zstd/GlobalUsings.cs | 2 +- src/Zaabee.Zstd/Zstd.Extensions.Bytes.cs | 9 ++-- .../Zstd.Extensions.Stream.Async.cs | 18 ++++---- src/Zaabee.Zstd/Zstd.Extensions.Stream.cs | 17 +++----- src/Zaabee.Zstd/Zstd.Extensions.String.cs | 10 ++--- src/Zaabee.Zstd/Zstd.Helper.Bytes.cs | 9 ++-- src/Zaabee.Zstd/Zstd.Helper.Stream.Async.cs | 14 ++++--- src/Zaabee.Zstd/Zstd.Helper.Stream.cs | 18 +++----- src/Zaabee.Zstd/Zstd.Helper.String.cs | 10 ++--- src/Zaabee.Zstd/Zstd.Helper.cs | 2 +- src/Zaabee.Zstd/ZstdCompressor.cs | 38 +++++++---------- tests/TestModel/Consts.cs | 2 +- tests/Zaabee.BrotliNET.UnitTest/BrotliTest.cs | 4 +- .../Zaabee.BrotliNET.UnitTest/GlobalUsings.cs | 2 +- .../CompressAndDecompressString.Test.cs | 5 +-- ...ompressToBytesAndDecompressToBytes.Test.cs | 2 +- ...mpressToBytesAndDecompressToStream.Test.cs | 2 +- ...mpressToStreamAndDecompressToBytes.Test.cs | 2 +- ...pressToStreamAndDecompressToStream.Test.cs | 2 +- ...ToStreamAndDecompressToStreamAsync.Test.cs | 2 +- .../GlobalUsings.cs | 2 +- tests/Zaabee.LZ4.UnitTest/GlobalUsings.cs | 2 +- tests/Zaabee.LZ4.UnitTest/Lz4Test.cs | 2 +- tests/Zaabee.LZMA.UnitTest/GlobalUsings.cs | 2 +- tests/Zaabee.LZMA.UnitTest/LzmaTest.cs | 2 +- .../Zaabee.SharpZipLib.UnitTest/BZip2Test.cs | 2 +- tests/Zaabee.SharpZipLib.UnitTest/GZipTest.cs | 4 +- .../GlobalUsings.cs | 2 +- tests/Zaabee.SharpZipLib.UnitTest/Usings.cs | 2 +- tests/Zaabee.Snappy.UnitTest/GlobalUsings.cs | 2 +- tests/Zaabee.Snappy.UnitTest/SnappyTest.cs | 2 +- tests/Zaabee.XZ.UnitTest/GlobalUsings.cs | 2 +- tests/Zaabee.XZ.UnitTest/XzTest.cs | 2 +- tests/Zaabee.Zstd.UnitTest/GlobalUsings.cs | 2 +- tests/Zaabee.Zstd.UnitTest/ZstdTest.cs | 2 +- 120 files changed, 593 insertions(+), 716 deletions(-) diff --git a/perf/Benchmark/Benchmarks/CompressToBytes.cs b/perf/Benchmark/Benchmarks/CompressToBytes.cs index 3793399..4c07f01 100644 --- a/perf/Benchmark/Benchmarks/CompressToBytes.cs +++ b/perf/Benchmark/Benchmarks/CompressToBytes.cs @@ -28,4 +28,4 @@ public class CompressToBytes [Benchmark] public void ZstdToBytes() => ZstdHelper.Compress(Consts.RawBytes); -} \ No newline at end of file +} diff --git a/perf/Benchmark/Benchmarks/CompressToStream.cs b/perf/Benchmark/Benchmarks/CompressToStream.cs index 2bb0fca..802a354 100644 --- a/perf/Benchmark/Benchmarks/CompressToStream.cs +++ b/perf/Benchmark/Benchmarks/CompressToStream.cs @@ -28,4 +28,4 @@ public class CompressToStream [Benchmark] public void ZstdToStream() => ZstdHelper.Compress(Consts.RawStream, new MemoryStream()); -} \ No newline at end of file +} diff --git a/perf/Benchmark/Benchmarks/DecompressFromBytes.cs b/perf/Benchmark/Benchmarks/DecompressFromBytes.cs index bceeb0a..4cc5d14 100644 --- a/perf/Benchmark/Benchmarks/DecompressFromBytes.cs +++ b/perf/Benchmark/Benchmarks/DecompressFromBytes.cs @@ -36,4 +36,4 @@ public class DecompressFromBytes [Benchmark] public void ZstdFromBytes() => ZstdHelper.Decompress(ZstdCompressBytes); -} \ No newline at end of file +} diff --git a/perf/Benchmark/Benchmarks/DecompressFromStream.cs b/perf/Benchmark/Benchmarks/DecompressFromStream.cs index 98e2966..fdd6d3f 100644 --- a/perf/Benchmark/Benchmarks/DecompressFromStream.cs +++ b/perf/Benchmark/Benchmarks/DecompressFromStream.cs @@ -5,8 +5,12 @@ [MinColumn, MaxColumn, MeanColumn, MedianColumn] public class DecompressFromStream { - private static readonly MemoryStream BrotliCompressStream = BrotliHelper.Compress(Consts.RawStream); - private static readonly MemoryStream BzipCompressStream = Bzip2Helper.Compress(Consts.RawStream); + private static readonly MemoryStream BrotliCompressStream = BrotliHelper.Compress( + Consts.RawStream + ); + private static readonly MemoryStream BzipCompressStream = Bzip2Helper.Compress( + Consts.RawStream + ); private static readonly MemoryStream GzipCompressStream = GzipHelper.Compress(Consts.RawStream); private static readonly MemoryStream Lz4CompressStream = Lz4Helper.Compress(Consts.RawStream); private static readonly MemoryStream LzmaCompressStream = LzmaHelper.Compress(Consts.RawStream); @@ -14,7 +18,8 @@ public class DecompressFromStream private static readonly MemoryStream ZstdCompressStream = ZstdHelper.Compress(Consts.RawStream); [Benchmark] - public void BrotliFromStream() => BrotliHelper.Decompress(BrotliCompressStream, new MemoryStream()); + public void BrotliFromStream() => + BrotliHelper.Decompress(BrotliCompressStream, new MemoryStream()); [Benchmark] public void Bzip2FromStream() => Bzip2Helper.Decompress(BzipCompressStream, new MemoryStream()); @@ -36,4 +41,4 @@ public class DecompressFromStream [Benchmark] public void ZstdFromStream() => ZstdHelper.Decompress(ZstdCompressStream, new MemoryStream()); -} \ No newline at end of file +} diff --git a/perf/Benchmark/Consts.cs b/perf/Benchmark/Consts.cs index e166ae0..ec0c715 100644 --- a/perf/Benchmark/Consts.cs +++ b/perf/Benchmark/Consts.cs @@ -4,4 +4,4 @@ public static class Consts { public static readonly byte[] RawBytes = new byte[1024 * 10]; public static readonly MemoryStream RawStream = new(RawBytes); -} \ No newline at end of file +} diff --git a/perf/Benchmark/GlobalUsings.cs b/perf/Benchmark/GlobalUsings.cs index 41fe6d4..1dfc88e 100644 --- a/perf/Benchmark/GlobalUsings.cs +++ b/perf/Benchmark/GlobalUsings.cs @@ -9,4 +9,4 @@ global using Zaabee.SharpZipLib; global using Zaabee.Snappy; global using Zaabee.XZ; -global using Zaabee.Zstd; \ No newline at end of file +global using Zaabee.Zstd; diff --git a/perf/Benchmark/Program.cs b/perf/Benchmark/Program.cs index fbf7425..36f2db2 100644 --- a/perf/Benchmark/Program.cs +++ b/perf/Benchmark/Program.cs @@ -4,4 +4,4 @@ { Console.WriteLine(summary.ResultsDirectoryPath); Console.WriteLine(string.Join("\r\n", summary.Reports)); -} \ No newline at end of file +} diff --git a/src/Zaabee.Brotli/Brotli.Extensions.Bytes.cs b/src/Zaabee.Brotli/Brotli.Extensions.Bytes.cs index 2ebb859..680af96 100644 --- a/src/Zaabee.Brotli/Brotli.Extensions.Bytes.cs +++ b/src/Zaabee.Brotli/Brotli.Extensions.Bytes.cs @@ -5,9 +5,9 @@ public static partial class BrotliExtensions public static byte[] ToBrotli( this byte[] rawBytes, uint quality = BrotliHelper.Quality, - uint window = BrotliHelper.Window) => - BrotliHelper.Compress(rawBytes, quality, window); + uint window = BrotliHelper.Window + ) => BrotliHelper.Compress(rawBytes, quality, window); public static byte[] UnBrotli(this byte[] compressedBytes) => BrotliHelper.Decompress(compressedBytes); -} \ No newline at end of file +} diff --git a/src/Zaabee.Brotli/Brotli.Extensions.Stream.Async.cs b/src/Zaabee.Brotli/Brotli.Extensions.Stream.Async.cs index ce4b2c8..368ed36 100644 --- a/src/Zaabee.Brotli/Brotli.Extensions.Stream.Async.cs +++ b/src/Zaabee.Brotli/Brotli.Extensions.Stream.Async.cs @@ -7,24 +7,24 @@ public static ValueTask ToBrotliAsync( Stream outputStream, uint quality = BrotliHelper.Quality, uint window = BrotliHelper.Window, - CancellationToken cancellationToken = default) => - BrotliHelper.CompressAsync(rawStream, outputStream, quality, window, cancellationToken); + CancellationToken cancellationToken = default + ) => BrotliHelper.CompressAsync(rawStream, outputStream, quality, window, cancellationToken); public static ValueTask UnBrotliAsync( this Stream compressedStream, Stream outputStream, - CancellationToken cancellationToken = default) => - BrotliHelper.DecompressAsync(compressedStream, outputStream, cancellationToken); + CancellationToken cancellationToken = default + ) => BrotliHelper.DecompressAsync(compressedStream, outputStream, cancellationToken); public static ValueTask ToBrotliAsync( this Stream rawStream, uint quality = BrotliHelper.Quality, uint window = BrotliHelper.Window, - CancellationToken cancellationToken = default) => - BrotliHelper.CompressAsync(rawStream, quality, window, cancellationToken); + CancellationToken cancellationToken = default + ) => BrotliHelper.CompressAsync(rawStream, quality, window, cancellationToken); public static ValueTask UnBrotliAsync( this Stream compressedStream, - CancellationToken cancellationToken = default) => - BrotliHelper.DecompressAsync(compressedStream, cancellationToken); -} \ No newline at end of file + CancellationToken cancellationToken = default + ) => BrotliHelper.DecompressAsync(compressedStream, cancellationToken); +} diff --git a/src/Zaabee.Brotli/Brotli.Extensions.Stream.cs b/src/Zaabee.Brotli/Brotli.Extensions.Stream.cs index 719c882..f0d4f9e 100644 --- a/src/Zaabee.Brotli/Brotli.Extensions.Stream.cs +++ b/src/Zaabee.Brotli/Brotli.Extensions.Stream.cs @@ -6,20 +6,18 @@ public static void ToBrotli( this Stream rawStream, Stream outputStream, uint quality = BrotliHelper.Quality, - uint window = BrotliHelper.Window) => - BrotliHelper.Compress(rawStream, outputStream, quality, window); + uint window = BrotliHelper.Window + ) => BrotliHelper.Compress(rawStream, outputStream, quality, window); - public static void UnBrotli( - this Stream compressedStream, - Stream outputStream) => + public static void UnBrotli(this Stream compressedStream, Stream outputStream) => BrotliHelper.Decompress(compressedStream, outputStream); public static MemoryStream ToBrotli( this Stream rawStream, uint quality = BrotliHelper.Quality, - uint window = BrotliHelper.Window) => - BrotliHelper.Compress(rawStream, quality, window); + uint window = BrotliHelper.Window + ) => BrotliHelper.Compress(rawStream, quality, window); public static MemoryStream UnBrotli(this Stream compressedStream) => BrotliHelper.Decompress(compressedStream); -} \ No newline at end of file +} diff --git a/src/Zaabee.Brotli/Brotli.Extensions.String.cs b/src/Zaabee.Brotli/Brotli.Extensions.String.cs index 0339434..8aae60e 100644 --- a/src/Zaabee.Brotli/Brotli.Extensions.String.cs +++ b/src/Zaabee.Brotli/Brotli.Extensions.String.cs @@ -6,11 +6,9 @@ public static byte[] ToBrotli( this string str, uint quality = BrotliHelper.Quality, uint window = BrotliHelper.Window, - Encoding? encoding = null) => - BrotliHelper.Compress(str, quality, window, encoding); + Encoding? encoding = null + ) => BrotliHelper.Compress(str, quality, window, encoding); - public static string UnBrotliToString( - this byte[] compressedBytes, - Encoding? encoding = null) => + public static string UnBrotliToString(this byte[] compressedBytes, Encoding? encoding = null) => BrotliHelper.DecompressToString(compressedBytes); -} \ No newline at end of file +} diff --git a/src/Zaabee.Brotli/Brotli.Helper.Bytes.cs b/src/Zaabee.Brotli/Brotli.Helper.Bytes.cs index f628896..4802017 100644 --- a/src/Zaabee.Brotli/Brotli.Helper.Bytes.cs +++ b/src/Zaabee.Brotli/Brotli.Helper.Bytes.cs @@ -2,12 +2,9 @@ public static partial class BrotliHelper { - public static byte[] Compress( - byte[] rawBytes, - uint quality = Quality, - uint window = Window) => + public static byte[] Compress(byte[] rawBytes, uint quality = Quality, uint window = Window) => rawBytes.CompressToBrotli(quality, window); public static byte[] Decompress(byte[] compressedBytes) => compressedBytes.DecompressFromBrotli(); -} \ No newline at end of file +} diff --git a/src/Zaabee.Brotli/Brotli.Helper.Stream.Async.cs b/src/Zaabee.Brotli/Brotli.Helper.Stream.Async.cs index e9fed95..29bf7ab 100644 --- a/src/Zaabee.Brotli/Brotli.Helper.Stream.Async.cs +++ b/src/Zaabee.Brotli/Brotli.Helper.Stream.Async.cs @@ -6,7 +6,8 @@ public static async ValueTask CompressAsync( Stream inputStream, uint quality = Quality, uint window = Window, - CancellationToken cancellationToken = default) + CancellationToken cancellationToken = default + ) { var outputStream = new MemoryStream(); await CompressAsync(inputStream, outputStream, quality, window, cancellationToken); @@ -15,7 +16,8 @@ public static async ValueTask CompressAsync( public static async ValueTask DecompressAsync( Stream inputStream, - CancellationToken cancellationToken = default) + CancellationToken cancellationToken = default + ) { var outputStream = new MemoryStream(); await DecompressAsync(inputStream, outputStream, cancellationToken); @@ -27,7 +29,8 @@ public static async ValueTask CompressAsync( Stream outputStream, uint quality = Quality, uint window = Window, - CancellationToken cancellationToken = default) + CancellationToken cancellationToken = default + ) { #if NETSTANDARD2_0 using (var brotliStream = new BrotliStream(outputStream, CompressionMode.Compress, true)) @@ -36,7 +39,9 @@ public static async ValueTask CompressAsync( brotliStream.SetWindow(window); await inputStream.CopyToAsync(brotliStream); #else - await using (var brotliStream = new BrotliStream(outputStream, CompressionMode.Compress, true)) + await using ( + var brotliStream = new BrotliStream(outputStream, CompressionMode.Compress, true) + ) { brotliStream.SetQuality(quality); brotliStream.SetWindow(window); @@ -50,16 +55,19 @@ public static async ValueTask CompressAsync( public static async ValueTask DecompressAsync( Stream inputStream, Stream outputStream, - CancellationToken cancellationToken = default) + CancellationToken cancellationToken = default + ) { #if NETSTANDARD2_0 using (var brotliStream = new BrotliStream(inputStream, CompressionMode.Decompress, true)) await brotliStream.CopyToAsync(outputStream); #else - await using (var brotliStream = new BrotliStream(inputStream, CompressionMode.Decompress, true)) + await using ( + var brotliStream = new BrotliStream(inputStream, CompressionMode.Decompress, true) + ) await brotliStream.CopyToAsync(outputStream, cancellationToken); #endif inputStream.TrySeek(0, SeekOrigin.Begin); outputStream.TrySeek(0, SeekOrigin.Begin); } -} \ No newline at end of file +} diff --git a/src/Zaabee.Brotli/Brotli.Helper.Stream.cs b/src/Zaabee.Brotli/Brotli.Helper.Stream.cs index 7765f3f..e25ebcf 100644 --- a/src/Zaabee.Brotli/Brotli.Helper.Stream.cs +++ b/src/Zaabee.Brotli/Brotli.Helper.Stream.cs @@ -5,15 +5,15 @@ public static partial class BrotliHelper public static MemoryStream Compress( Stream inputStream, uint quality = Quality, - uint window = Window) + uint window = Window + ) { var outputStream = new MemoryStream(); Compress(inputStream, outputStream, quality, window); return outputStream; } - public static MemoryStream Decompress( - Stream inputStream) + public static MemoryStream Decompress(Stream inputStream) { var outputStream = new MemoryStream(); Decompress(inputStream, outputStream); @@ -24,7 +24,8 @@ public static void Compress( Stream inputStream, Stream outputStream, uint quality = Quality, - uint window = Window) + uint window = Window + ) { using (var brotliStream = new BrotliStream(outputStream, CompressionMode.Compress, true)) { @@ -36,13 +37,11 @@ public static void Compress( outputStream.TrySeek(0, SeekOrigin.Begin); } - public static void Decompress( - Stream inputStream, - Stream outputStream) + public static void Decompress(Stream inputStream, Stream outputStream) { using (var brotliStream = new BrotliStream(inputStream, CompressionMode.Decompress, true)) brotliStream.CopyTo(outputStream); inputStream.TrySeek(0, SeekOrigin.Begin); outputStream.TrySeek(0, SeekOrigin.Begin); } -} \ No newline at end of file +} diff --git a/src/Zaabee.Brotli/Brotli.Helper.String.cs b/src/Zaabee.Brotli/Brotli.Helper.String.cs index d98b900..7afc99a 100644 --- a/src/Zaabee.Brotli/Brotli.Helper.String.cs +++ b/src/Zaabee.Brotli/Brotli.Helper.String.cs @@ -6,12 +6,9 @@ public static byte[] Compress( string str, uint quality = Quality, uint window = Window, - Encoding? encoding = null) => - Compress(str.GetBytes(encoding ?? Consts.DefaultEncoding), quality, window); + Encoding? encoding = null + ) => Compress(str.GetBytes(encoding ?? Consts.DefaultEncoding), quality, window); - public static string DecompressToString( - byte[] compressedBytes, - Encoding? encoding = null) => - Decompress(compressedBytes) - .GetString(encoding ?? Consts.DefaultEncoding); -} \ No newline at end of file + public static string DecompressToString(byte[] compressedBytes, Encoding? encoding = null) => + Decompress(compressedBytes).GetString(encoding ?? Consts.DefaultEncoding); +} diff --git a/src/Zaabee.Brotli/Brotli.Helper.cs b/src/Zaabee.Brotli/Brotli.Helper.cs index 14907f2..9c212fb 100644 --- a/src/Zaabee.Brotli/Brotli.Helper.cs +++ b/src/Zaabee.Brotli/Brotli.Helper.cs @@ -4,4 +4,4 @@ public static partial class BrotliHelper { internal const uint Quality = 5; internal const uint Window = 22; -} \ No newline at end of file +} diff --git a/src/Zaabee.Brotli/BrotliCompressor.cs b/src/Zaabee.Brotli/BrotliCompressor.cs index d08357c..b03c0f2 100644 --- a/src/Zaabee.Brotli/BrotliCompressor.cs +++ b/src/Zaabee.Brotli/BrotliCompressor.cs @@ -5,9 +5,7 @@ public sealed class BrotliCompressor : ICompressor private readonly uint _quality; private readonly uint _window; - public BrotliCompressor( - uint quality = BrotliHelper.Quality, - uint window = BrotliHelper.Window) + public BrotliCompressor(uint quality = BrotliHelper.Quality, uint window = BrotliHelper.Window) { _quality = quality; _window = window; @@ -15,45 +13,37 @@ public BrotliCompressor( public ValueTask CompressAsync( Stream rawStream, - CancellationToken cancellationToken = default) => - rawStream.ToBrotliAsync(_quality, _window, cancellationToken); + CancellationToken cancellationToken = default + ) => rawStream.ToBrotliAsync(_quality, _window, cancellationToken); public ValueTask DecompressAsync( Stream compressedStream, - CancellationToken cancellationToken = default) => - compressedStream.UnBrotliAsync(cancellationToken); + CancellationToken cancellationToken = default + ) => compressedStream.UnBrotliAsync(cancellationToken); public ValueTask CompressAsync( Stream inputStream, Stream outputStream, - CancellationToken cancellationToken = default) => - inputStream.ToBrotliAsync(outputStream, _quality, _window, cancellationToken); + CancellationToken cancellationToken = default + ) => inputStream.ToBrotliAsync(outputStream, _quality, _window, cancellationToken); public ValueTask DecompressAsync( Stream inputStream, Stream outputStream, - CancellationToken cancellationToken = default) => - inputStream.UnBrotliAsync(outputStream, cancellationToken); + CancellationToken cancellationToken = default + ) => inputStream.UnBrotliAsync(outputStream, cancellationToken); - public byte[] Compress(byte[] rawBytes) => - rawBytes.ToBrotli(_quality, _window); + public byte[] Compress(byte[] rawBytes) => rawBytes.ToBrotli(_quality, _window); - public byte[] Decompress(byte[] compressedBytes) => - compressedBytes.UnBrotli(); + public byte[] Decompress(byte[] compressedBytes) => compressedBytes.UnBrotli(); - public MemoryStream Compress(Stream rawStream) => - rawStream.ToBrotli(_quality, _window); + public MemoryStream Compress(Stream rawStream) => rawStream.ToBrotli(_quality, _window); - public MemoryStream Decompress(Stream compressedStream) => - compressedStream.UnBrotli(); + public MemoryStream Decompress(Stream compressedStream) => compressedStream.UnBrotli(); - public void Compress( - Stream inputStream, - Stream outputStream) => + public void Compress(Stream inputStream, Stream outputStream) => inputStream.ToBrotli(outputStream, _quality, _window); - public void Decompress( - Stream inputStream, - Stream outputStream) => + public void Decompress(Stream inputStream, Stream outputStream) => inputStream.UnBrotli(outputStream); -} \ No newline at end of file +} diff --git a/src/Zaabee.Brotli/GlobalUsings.cs b/src/Zaabee.Brotli/GlobalUsings.cs index 64dcce3..ff47178 100644 --- a/src/Zaabee.Brotli/GlobalUsings.cs +++ b/src/Zaabee.Brotli/GlobalUsings.cs @@ -5,4 +5,4 @@ global using Brotli; global using Zaabee.Compressor.Abstractions; global using Zaabee.Extensions; -global using BrotliStream = Brotli.BrotliStream; \ No newline at end of file +global using BrotliStream = Brotli.BrotliStream; diff --git a/src/Zaabee.Compressor.Abstractions/Consts.cs b/src/Zaabee.Compressor.Abstractions/Consts.cs index bbbd0c9..48aa763 100644 --- a/src/Zaabee.Compressor.Abstractions/Consts.cs +++ b/src/Zaabee.Compressor.Abstractions/Consts.cs @@ -3,4 +3,4 @@ public static class Consts { public static readonly Encoding DefaultEncoding = Encoding.UTF8; -} \ No newline at end of file +} diff --git a/src/Zaabee.Compressor.Abstractions/GlobalUsings.cs b/src/Zaabee.Compressor.Abstractions/GlobalUsings.cs index cdd9b06..1b8ef32 100644 --- a/src/Zaabee.Compressor.Abstractions/GlobalUsings.cs +++ b/src/Zaabee.Compressor.Abstractions/GlobalUsings.cs @@ -4,4 +4,4 @@ global using System.Text; global using System.Threading; global using System.Threading.Tasks; -global using Zaabee.Extensions; \ No newline at end of file +global using Zaabee.Extensions; diff --git a/src/Zaabee.Compressor.Abstractions/ICompressor.Bytes.cs b/src/Zaabee.Compressor.Abstractions/ICompressor.Bytes.cs index 224db56..7458b64 100644 --- a/src/Zaabee.Compressor.Abstractions/ICompressor.Bytes.cs +++ b/src/Zaabee.Compressor.Abstractions/ICompressor.Bytes.cs @@ -8,10 +8,15 @@ public partial interface ICompressor public static class CompressorExtensions { - public static byte[] Compress(this ICompressor compressor, string str, Encoding? encoding = null) => - compressor.Compress(str.GetBytes(encoding ?? Consts.DefaultEncoding)); + public static byte[] Compress( + this ICompressor compressor, + string str, + Encoding? encoding = null + ) => compressor.Compress(str.GetBytes(encoding ?? Consts.DefaultEncoding)); - public static string DecompressToString(this ICompressor compressor, byte[] bytes, Encoding? encoding = null) => - compressor.Decompress(bytes) - .GetString(encoding ?? Consts.DefaultEncoding); -} \ No newline at end of file + public static string DecompressToString( + this ICompressor compressor, + byte[] bytes, + Encoding? encoding = null + ) => compressor.Decompress(bytes).GetString(encoding ?? Consts.DefaultEncoding); +} diff --git a/src/Zaabee.Compressor.Abstractions/ICompressor.Stream.Async.cs b/src/Zaabee.Compressor.Abstractions/ICompressor.Stream.Async.cs index 37fbaad..9a0279d 100644 --- a/src/Zaabee.Compressor.Abstractions/ICompressor.Stream.Async.cs +++ b/src/Zaabee.Compressor.Abstractions/ICompressor.Stream.Async.cs @@ -2,8 +2,22 @@ public partial interface ICompressor { - ValueTask CompressAsync(Stream rawStream, CancellationToken cancellationToken = default); - ValueTask CompressAsync(Stream inputStream, Stream outputStream, CancellationToken cancellationToken = default); - ValueTask DecompressAsync(Stream compressedStream, CancellationToken cancellationToken = default); - ValueTask DecompressAsync(Stream inputStream, Stream outputStream, CancellationToken cancellationToken = default); -} \ No newline at end of file + ValueTask CompressAsync( + Stream rawStream, + CancellationToken cancellationToken = default + ); + ValueTask CompressAsync( + Stream inputStream, + Stream outputStream, + CancellationToken cancellationToken = default + ); + ValueTask DecompressAsync( + Stream compressedStream, + CancellationToken cancellationToken = default + ); + ValueTask DecompressAsync( + Stream inputStream, + Stream outputStream, + CancellationToken cancellationToken = default + ); +} diff --git a/src/Zaabee.Compressor.Abstractions/ICompressor.Stream.cs b/src/Zaabee.Compressor.Abstractions/ICompressor.Stream.cs index 10fef5b..fe92e80 100644 --- a/src/Zaabee.Compressor.Abstractions/ICompressor.Stream.cs +++ b/src/Zaabee.Compressor.Abstractions/ICompressor.Stream.cs @@ -6,4 +6,4 @@ public partial interface ICompressor void Compress(Stream inputStream, Stream outputStream); MemoryStream Decompress(Stream compressedStream); void Decompress(Stream inputStream, Stream outputStream); -} \ No newline at end of file +} diff --git a/src/Zaabee.Compressor.Abstractions/NullCompressor.cs b/src/Zaabee.Compressor.Abstractions/NullCompressor.cs index 0f3cd43..786de79 100644 --- a/src/Zaabee.Compressor.Abstractions/NullCompressor.cs +++ b/src/Zaabee.Compressor.Abstractions/NullCompressor.cs @@ -2,13 +2,14 @@ public sealed class NullCompressor : ICompressor { - public byte[] Compress(byte[] rawBytes) => - rawBytes.CloneNew(); + public byte[] Compress(byte[] rawBytes) => rawBytes.CloneNew(); - public byte[] Decompress(byte[] compressedBytes) => - compressedBytes.CloneNew(); + public byte[] Decompress(byte[] compressedBytes) => compressedBytes.CloneNew(); - public async ValueTask CompressAsync(Stream rawStream, CancellationToken cancellationToken = default) + public async ValueTask CompressAsync( + Stream rawStream, + CancellationToken cancellationToken = default + ) { var memoryStream = new MemoryStream(); #if NETSTANDARD2_0 @@ -21,8 +22,10 @@ public async ValueTask CompressAsync(Stream rawStream, Cancellatio return memoryStream; } - public async ValueTask DecompressAsync(Stream compressedStream, - CancellationToken cancellationToken = default) + public async ValueTask DecompressAsync( + Stream compressedStream, + CancellationToken cancellationToken = default + ) { var memoryStream = new MemoryStream(); #if NETSTANDARD2_0 @@ -35,8 +38,11 @@ public async ValueTask DecompressAsync(Stream compressedStream, return memoryStream; } - public async ValueTask CompressAsync(Stream inputStream, Stream outputStream, - CancellationToken cancellationToken = default) + public async ValueTask CompressAsync( + Stream inputStream, + Stream outputStream, + CancellationToken cancellationToken = default + ) { #if NETSTANDARD2_0 await inputStream.CopyToAsync(outputStream); @@ -47,8 +53,11 @@ public async ValueTask CompressAsync(Stream inputStream, Stream outputStream, outputStream.TrySeek(0, SeekOrigin.Begin); } - public async ValueTask DecompressAsync(Stream inputStream, Stream outputStream, - CancellationToken cancellationToken = default) + public async ValueTask DecompressAsync( + Stream inputStream, + Stream outputStream, + CancellationToken cancellationToken = default + ) { #if NETSTANDARD2_0 await inputStream.CopyToAsync(outputStream); @@ -90,4 +99,4 @@ public void Decompress(Stream inputStream, Stream outputStream) inputStream.TrySeek(0, SeekOrigin.Begin); outputStream.TrySeek(0, SeekOrigin.Begin); } -} \ No newline at end of file +} diff --git a/src/Zaabee.LZ4/GlobalUsings.cs b/src/Zaabee.LZ4/GlobalUsings.cs index aa1990b..ce951ae 100644 --- a/src/Zaabee.LZ4/GlobalUsings.cs +++ b/src/Zaabee.LZ4/GlobalUsings.cs @@ -4,4 +4,4 @@ global using K4os.Compression.LZ4; global using K4os.Compression.LZ4.Streams; global using Zaabee.Compressor.Abstractions; -global using Zaabee.Extensions; \ No newline at end of file +global using Zaabee.Extensions; diff --git a/src/Zaabee.LZ4/LZ4.Extensions.Bytes.cs b/src/Zaabee.LZ4/LZ4.Extensions.Bytes.cs index 50703d8..053d55d 100644 --- a/src/Zaabee.LZ4/LZ4.Extensions.Bytes.cs +++ b/src/Zaabee.LZ4/LZ4.Extensions.Bytes.cs @@ -5,12 +5,12 @@ public static partial class Lz4Extensions public static byte[] ToLz4( this byte[] rawBytes, LZ4Level level = Lz4Helper.Level, - int extraMemory = Lz4Helper.ExtraMemory) => - Lz4Helper.Compress(rawBytes, level, extraMemory); + int extraMemory = Lz4Helper.ExtraMemory + ) => Lz4Helper.Compress(rawBytes, level, extraMemory); public static byte[] UnLz4( this byte[] compressedBytes, LZ4DecoderSettings? settings = Lz4Helper.Settings, - bool interactive = Lz4Helper.Interactive) => - Lz4Helper.Decompress(compressedBytes, settings, interactive); -} \ No newline at end of file + bool interactive = Lz4Helper.Interactive + ) => Lz4Helper.Decompress(compressedBytes, settings, interactive); +} diff --git a/src/Zaabee.LZ4/LZ4.Extensions.Stream.Async.cs b/src/Zaabee.LZ4/LZ4.Extensions.Stream.Async.cs index a8fba14..7e0b9cf 100644 --- a/src/Zaabee.LZ4/LZ4.Extensions.Stream.Async.cs +++ b/src/Zaabee.LZ4/LZ4.Extensions.Stream.Async.cs @@ -7,28 +7,35 @@ public static ValueTask ToLz4Async( Stream outputStream, LZ4Level level = Lz4Helper.Level, int extraMemory = Lz4Helper.ExtraMemory, - CancellationToken cancellationToken = default) => - Lz4Helper.CompressAsync(rawStream, outputStream, level, extraMemory, cancellationToken); + CancellationToken cancellationToken = default + ) => Lz4Helper.CompressAsync(rawStream, outputStream, level, extraMemory, cancellationToken); public static ValueTask UnLz4Async( this Stream compressedStream, Stream outputStream, LZ4DecoderSettings? settings = Lz4Helper.Settings, bool interactive = Lz4Helper.Interactive, - CancellationToken cancellationToken = default) => - Lz4Helper.DecompressAsync(compressedStream, outputStream, settings, interactive, cancellationToken); + CancellationToken cancellationToken = default + ) => + Lz4Helper.DecompressAsync( + compressedStream, + outputStream, + settings, + interactive, + cancellationToken + ); public static ValueTask ToLz4Async( this Stream rawStream, LZ4Level level = Lz4Helper.Level, int extraMemory = Lz4Helper.ExtraMemory, - CancellationToken cancellationToken = default) => - Lz4Helper.CompressAsync(rawStream, level, extraMemory, cancellationToken); + CancellationToken cancellationToken = default + ) => Lz4Helper.CompressAsync(rawStream, level, extraMemory, cancellationToken); public static ValueTask UnLz4Async( this Stream compressedStream, LZ4DecoderSettings? settings = Lz4Helper.Settings, bool interactive = Lz4Helper.Interactive, - CancellationToken cancellationToken = default) => - Lz4Helper.DecompressAsync(compressedStream, settings, interactive, cancellationToken); -} \ No newline at end of file + CancellationToken cancellationToken = default + ) => Lz4Helper.DecompressAsync(compressedStream, settings, interactive, cancellationToken); +} diff --git a/src/Zaabee.LZ4/LZ4.Extensions.Stream.cs b/src/Zaabee.LZ4/LZ4.Extensions.Stream.cs index 6b67a04..2bb24a9 100644 --- a/src/Zaabee.LZ4/LZ4.Extensions.Stream.cs +++ b/src/Zaabee.LZ4/LZ4.Extensions.Stream.cs @@ -6,25 +6,25 @@ public static void ToLz4( this Stream rawStream, Stream outputStream, LZ4Level level = Lz4Helper.Level, - int extraMemory = Lz4Helper.ExtraMemory) => - Lz4Helper.Compress(rawStream, outputStream, level, extraMemory); + int extraMemory = Lz4Helper.ExtraMemory + ) => Lz4Helper.Compress(rawStream, outputStream, level, extraMemory); public static void UnLz4( this Stream compressedStream, Stream outputStream, LZ4DecoderSettings? settings = Lz4Helper.Settings, - bool interactive = Lz4Helper.Interactive) => - Lz4Helper.Decompress(compressedStream, outputStream, settings, interactive); + bool interactive = Lz4Helper.Interactive + ) => Lz4Helper.Decompress(compressedStream, outputStream, settings, interactive); public static MemoryStream ToLz4( this Stream rawStream, LZ4Level level = Lz4Helper.Level, - int extraMemory = Lz4Helper.ExtraMemory) => - Lz4Helper.Compress(rawStream, level, extraMemory); + int extraMemory = Lz4Helper.ExtraMemory + ) => Lz4Helper.Compress(rawStream, level, extraMemory); public static MemoryStream UnLz4( this Stream compressedStream, LZ4DecoderSettings? settings = Lz4Helper.Settings, - bool interactive = Lz4Helper.Interactive) => - Lz4Helper.Decompress(compressedStream, settings, interactive); -} \ No newline at end of file + bool interactive = Lz4Helper.Interactive + ) => Lz4Helper.Decompress(compressedStream, settings, interactive); +} diff --git a/src/Zaabee.LZ4/LZ4.Extensions.String.cs b/src/Zaabee.LZ4/LZ4.Extensions.String.cs index c349920..37c58cf 100644 --- a/src/Zaabee.LZ4/LZ4.Extensions.String.cs +++ b/src/Zaabee.LZ4/LZ4.Extensions.String.cs @@ -6,13 +6,13 @@ public static byte[] ToLz4( this string str, LZ4Level level = Lz4Helper.Level, int extraMemory = Lz4Helper.ExtraMemory, - Encoding? encoding = null) => - Lz4Helper.Compress(str, level, extraMemory, encoding); + Encoding? encoding = null + ) => Lz4Helper.Compress(str, level, extraMemory, encoding); public static string UnLz4ToString( this byte[] compressedBytes, LZ4DecoderSettings? settings = Lz4Helper.Settings, bool interactive = Lz4Helper.Interactive, - Encoding? encoding = null) => - Lz4Helper.DecompressToString(compressedBytes, settings, interactive, encoding); -} \ No newline at end of file + Encoding? encoding = null + ) => Lz4Helper.DecompressToString(compressedBytes, settings, interactive, encoding); +} diff --git a/src/Zaabee.LZ4/LZ4.Helper.Bytes.cs b/src/Zaabee.LZ4/LZ4.Helper.Bytes.cs index 8d72adb..e555350 100644 --- a/src/Zaabee.LZ4/LZ4.Helper.Bytes.cs +++ b/src/Zaabee.LZ4/LZ4.Helper.Bytes.cs @@ -5,7 +5,8 @@ public static partial class Lz4Helper public static byte[] Compress( byte[] rawBytes, LZ4Level level = Level, - int extraMemory = ExtraMemory) + int extraMemory = ExtraMemory + ) { var outputStream = new MemoryStream(); Compress(new MemoryStream(rawBytes), outputStream, level, extraMemory); @@ -15,10 +16,11 @@ public static byte[] Compress( public static byte[] Decompress( byte[] compressedBytes, LZ4DecoderSettings? settings = Settings, - bool interactive = Interactive) + bool interactive = Interactive + ) { var outputStream = new MemoryStream(); Decompress(new MemoryStream(compressedBytes), outputStream, settings, interactive); return outputStream.ToArray(); } -} \ No newline at end of file +} diff --git a/src/Zaabee.LZ4/LZ4.Helper.Stream.Async.cs b/src/Zaabee.LZ4/LZ4.Helper.Stream.Async.cs index 5899cb1..65558b3 100644 --- a/src/Zaabee.LZ4/LZ4.Helper.Stream.Async.cs +++ b/src/Zaabee.LZ4/LZ4.Helper.Stream.Async.cs @@ -6,7 +6,8 @@ public static async ValueTask CompressAsync( Stream inputStream, LZ4Level level = Level, int extraMemory = ExtraMemory, - CancellationToken cancellationToken = default) + CancellationToken cancellationToken = default + ) { var outputStream = new MemoryStream(); await CompressAsync(inputStream, outputStream, level, extraMemory, cancellationToken); @@ -17,7 +18,8 @@ public static async ValueTask DecompressAsync( Stream inputStream, LZ4DecoderSettings? settings = Settings, bool interactive = Interactive, - CancellationToken cancellationToken = default) + CancellationToken cancellationToken = default + ) { var outputStream = new MemoryStream(); await DecompressAsync(inputStream, outputStream, settings, interactive, cancellationToken); @@ -29,7 +31,8 @@ public static async ValueTask CompressAsync( Stream outputStream, LZ4Level level = Level, int extraMemory = ExtraMemory, - CancellationToken cancellationToken = default) + CancellationToken cancellationToken = default + ) { #if NETSTANDARD2_0 using (var lz4Stream = LZ4Stream.Encode(outputStream, level, extraMemory, true)) @@ -47,7 +50,8 @@ public static async ValueTask DecompressAsync( Stream outputStream, LZ4DecoderSettings? settings = Settings, bool interactive = Interactive, - CancellationToken cancellationToken = default) + CancellationToken cancellationToken = default + ) { #if NETSTANDARD2_0 using (var lz4Stream = LZ4Stream.Decode(inputStream, settings, true, interactive)) @@ -59,4 +63,4 @@ public static async ValueTask DecompressAsync( inputStream.TrySeek(0, SeekOrigin.Begin); outputStream.TrySeek(0, SeekOrigin.Begin); } -} \ No newline at end of file +} diff --git a/src/Zaabee.LZ4/LZ4.Helper.Stream.cs b/src/Zaabee.LZ4/LZ4.Helper.Stream.cs index 15befb0..73245e3 100644 --- a/src/Zaabee.LZ4/LZ4.Helper.Stream.cs +++ b/src/Zaabee.LZ4/LZ4.Helper.Stream.cs @@ -5,7 +5,8 @@ public static partial class Lz4Helper public static MemoryStream Compress( Stream inputStream, LZ4Level level = Level, - int extraMemory = ExtraMemory) + int extraMemory = ExtraMemory + ) { var outputStream = new MemoryStream(); Compress(inputStream, outputStream, level, extraMemory); @@ -15,7 +16,8 @@ public static MemoryStream Compress( public static MemoryStream Decompress( Stream inputStream, LZ4DecoderSettings? settings = Settings, - bool interactive = Interactive) + bool interactive = Interactive + ) { var outputStream = new MemoryStream(); Decompress(inputStream, outputStream, settings, interactive); @@ -26,7 +28,8 @@ public static void Compress( Stream inputStream, Stream outputStream, LZ4Level level = Level, - int extraMemory = ExtraMemory) + int extraMemory = ExtraMemory + ) { using (var lz4Stream = LZ4Stream.Encode(outputStream, level, extraMemory, true)) inputStream.CopyTo(lz4Stream); @@ -38,11 +41,12 @@ public static void Decompress( Stream inputStream, Stream outputStream, LZ4DecoderSettings? settings = Settings, - bool interactive = Interactive) + bool interactive = Interactive + ) { using (var lz4Stream = LZ4Stream.Decode(inputStream, settings, true, interactive)) lz4Stream.CopyTo(outputStream); inputStream.TrySeek(0, SeekOrigin.Begin); outputStream.TrySeek(0, SeekOrigin.Begin); } -} \ No newline at end of file +} diff --git a/src/Zaabee.LZ4/LZ4.Helper.String.cs b/src/Zaabee.LZ4/LZ4.Helper.String.cs index 419474b..a932b9a 100644 --- a/src/Zaabee.LZ4/LZ4.Helper.String.cs +++ b/src/Zaabee.LZ4/LZ4.Helper.String.cs @@ -6,14 +6,15 @@ public static byte[] Compress( string str, LZ4Level level = Level, int extraMemory = ExtraMemory, - Encoding? encoding = null) => - Compress(str.GetBytes(encoding ?? Consts.DefaultEncoding), level, extraMemory); + Encoding? encoding = null + ) => Compress(str.GetBytes(encoding ?? Consts.DefaultEncoding), level, extraMemory); public static string DecompressToString( byte[] compressedBytes, LZ4DecoderSettings? settings = Settings, bool interactive = Interactive, - Encoding? encoding = null) => + Encoding? encoding = null + ) => Decompress(compressedBytes, settings, interactive) .GetString(encoding ?? Consts.DefaultEncoding); -} \ No newline at end of file +} diff --git a/src/Zaabee.LZ4/LZ4.Helper.cs b/src/Zaabee.LZ4/LZ4.Helper.cs index c3b7696..0e9892f 100644 --- a/src/Zaabee.LZ4/LZ4.Helper.cs +++ b/src/Zaabee.LZ4/LZ4.Helper.cs @@ -6,4 +6,4 @@ public static partial class Lz4Helper internal const int ExtraMemory = 0; internal const bool Interactive = true; internal const LZ4DecoderSettings? Settings = null; -} \ No newline at end of file +} diff --git a/src/Zaabee.LZ4/Lz4Compressor.cs b/src/Zaabee.LZ4/Lz4Compressor.cs index b5df8fd..2674eee 100644 --- a/src/Zaabee.LZ4/Lz4Compressor.cs +++ b/src/Zaabee.LZ4/Lz4Compressor.cs @@ -11,7 +11,8 @@ public Lz4Compressor( LZ4Level level = Lz4Helper.Level, int extraMemory = Lz4Helper.ExtraMemory, bool interactive = Lz4Helper.Interactive, - LZ4DecoderSettings? settings = Lz4Helper.Settings) + LZ4DecoderSettings? settings = Lz4Helper.Settings + ) { _interactive = interactive; _settings = settings; @@ -21,45 +22,39 @@ public Lz4Compressor( public ValueTask CompressAsync( Stream rawStream, - CancellationToken cancellationToken = default) => - rawStream.ToLz4Async(_level, _extraMemory, cancellationToken); + CancellationToken cancellationToken = default + ) => rawStream.ToLz4Async(_level, _extraMemory, cancellationToken); public ValueTask DecompressAsync( Stream compressedStream, - CancellationToken cancellationToken = default) => - compressedStream.UnLz4Async(_settings, _interactive, cancellationToken); + CancellationToken cancellationToken = default + ) => compressedStream.UnLz4Async(_settings, _interactive, cancellationToken); public ValueTask CompressAsync( Stream inputStream, Stream outputStream, - CancellationToken cancellationToken = default) => - inputStream.ToLz4Async(outputStream, _level, _extraMemory, cancellationToken); + CancellationToken cancellationToken = default + ) => inputStream.ToLz4Async(outputStream, _level, _extraMemory, cancellationToken); public ValueTask DecompressAsync( Stream inputStream, Stream outputStream, - CancellationToken cancellationToken = default) => - inputStream.UnLz4Async(outputStream, _settings, _interactive, cancellationToken); + CancellationToken cancellationToken = default + ) => inputStream.UnLz4Async(outputStream, _settings, _interactive, cancellationToken); - public byte[] Compress(byte[] rawBytes) => - rawBytes.ToLz4(_level, _extraMemory); + public byte[] Compress(byte[] rawBytes) => rawBytes.ToLz4(_level, _extraMemory); public byte[] Decompress(byte[] compressedBytes) => compressedBytes.UnLz4(_settings, _interactive); - public MemoryStream Compress(Stream rawStream) => - rawStream.ToLz4(_level, _extraMemory); + public MemoryStream Compress(Stream rawStream) => rawStream.ToLz4(_level, _extraMemory); public MemoryStream Decompress(Stream compressedStream) => compressedStream.UnLz4(_settings, _interactive); - public void Compress( - Stream inputStream, - Stream outputStream) => + public void Compress(Stream inputStream, Stream outputStream) => inputStream.ToLz4(outputStream, _level, _extraMemory); - public void Decompress( - Stream inputStream, - Stream outputStream) => + public void Decompress(Stream inputStream, Stream outputStream) => inputStream.UnLz4(outputStream, _settings, _interactive); -} \ No newline at end of file +} diff --git a/src/Zaabee.LZMA/GlobalUsings.cs b/src/Zaabee.LZMA/GlobalUsings.cs index 62c62c6..f8a0e49 100644 --- a/src/Zaabee.LZMA/GlobalUsings.cs +++ b/src/Zaabee.LZMA/GlobalUsings.cs @@ -2,4 +2,4 @@ global using System.Text; global using Zaabee.Compressor.Abstractions; -global using Zaabee.Extensions; \ No newline at end of file +global using Zaabee.Extensions; diff --git a/src/Zaabee.LZMA/LZMA.Extensions.Bytes.cs b/src/Zaabee.LZMA/LZMA.Extensions.Bytes.cs index ee381c7..b8df61f 100644 --- a/src/Zaabee.LZMA/LZMA.Extensions.Bytes.cs +++ b/src/Zaabee.LZMA/LZMA.Extensions.Bytes.cs @@ -2,11 +2,8 @@ public static partial class LzmaExtensions { - public static byte[] ToLzma( - this byte[] rawBytes) => - LzmaHelper.Compress(rawBytes); + public static byte[] ToLzma(this byte[] rawBytes) => LzmaHelper.Compress(rawBytes); - public static byte[] UnLzma( - this byte[] compressedBytes) => + public static byte[] UnLzma(this byte[] compressedBytes) => LzmaHelper.Decompress(compressedBytes); -} \ No newline at end of file +} diff --git a/src/Zaabee.LZMA/LZMA.Extensions.Stream.Async.cs b/src/Zaabee.LZMA/LZMA.Extensions.Stream.Async.cs index dd8fdc5..88701ab 100644 --- a/src/Zaabee.LZMA/LZMA.Extensions.Stream.Async.cs +++ b/src/Zaabee.LZMA/LZMA.Extensions.Stream.Async.cs @@ -5,22 +5,22 @@ public static partial class LzmaExtensions public static ValueTask ToLzmaAsync( this Stream rawStream, Stream outputStream, - CancellationToken cancellationToken = default) => - LzmaHelper.CompressAsync(rawStream, outputStream, cancellationToken); + CancellationToken cancellationToken = default + ) => LzmaHelper.CompressAsync(rawStream, outputStream, cancellationToken); public static ValueTask UnLzmaAsync( this Stream compressedStream, Stream outputStream, - CancellationToken cancellationToken = default) => - LzmaHelper.DecompressAsync(compressedStream, outputStream, cancellationToken); + CancellationToken cancellationToken = default + ) => LzmaHelper.DecompressAsync(compressedStream, outputStream, cancellationToken); public static ValueTask ToLzmaAsync( this Stream rawStream, - CancellationToken cancellationToken = default) => - LzmaHelper.CompressAsync(rawStream, cancellationToken); + CancellationToken cancellationToken = default + ) => LzmaHelper.CompressAsync(rawStream, cancellationToken); public static ValueTask UnLzmaAsync( this Stream compressedStream, - CancellationToken cancellationToken = default) => - LzmaHelper.DecompressAsync(compressedStream, cancellationToken); -} \ No newline at end of file + CancellationToken cancellationToken = default + ) => LzmaHelper.DecompressAsync(compressedStream, cancellationToken); +} diff --git a/src/Zaabee.LZMA/LZMA.Extensions.Stream.cs b/src/Zaabee.LZMA/LZMA.Extensions.Stream.cs index 45e7e87..0da2c22 100644 --- a/src/Zaabee.LZMA/LZMA.Extensions.Stream.cs +++ b/src/Zaabee.LZMA/LZMA.Extensions.Stream.cs @@ -2,21 +2,14 @@ public static partial class LzmaExtensions { - public static void ToLzma( - this Stream rawStream, - Stream outputStream) => + public static void ToLzma(this Stream rawStream, Stream outputStream) => LzmaHelper.Compress(rawStream, outputStream); - public static void UnLzma( - this Stream compressedStream, - Stream outputStream) => + public static void UnLzma(this Stream compressedStream, Stream outputStream) => LzmaHelper.Decompress(compressedStream, outputStream); - public static MemoryStream ToLzma( - this Stream rawStream) => - LzmaHelper.Compress(rawStream); + public static MemoryStream ToLzma(this Stream rawStream) => LzmaHelper.Compress(rawStream); - public static MemoryStream UnLzma( - this Stream compressedStream) => + public static MemoryStream UnLzma(this Stream compressedStream) => LzmaHelper.Decompress(compressedStream); -} \ No newline at end of file +} diff --git a/src/Zaabee.LZMA/LZMA.Extensions.String.cs b/src/Zaabee.LZMA/LZMA.Extensions.String.cs index b581f63..23c4732 100644 --- a/src/Zaabee.LZMA/LZMA.Extensions.String.cs +++ b/src/Zaabee.LZMA/LZMA.Extensions.String.cs @@ -2,13 +2,9 @@ public static partial class LzmaExtensions { - public static byte[] ToLzma( - this string str, - Encoding? encoding = null) => + public static byte[] ToLzma(this string str, Encoding? encoding = null) => LzmaHelper.Compress(str, encoding); - public static string UnLzmaToString( - this byte[] compressedBytes, - Encoding? encoding = null) => + public static string UnLzmaToString(this byte[] compressedBytes, Encoding? encoding = null) => LzmaHelper.DecompressToString(compressedBytes, encoding); -} \ No newline at end of file +} diff --git a/src/Zaabee.LZMA/LZMA.Helper.Bytes.cs b/src/Zaabee.LZMA/LZMA.Helper.Bytes.cs index aa26eea..c7c714d 100644 --- a/src/Zaabee.LZMA/LZMA.Helper.Bytes.cs +++ b/src/Zaabee.LZMA/LZMA.Helper.Bytes.cs @@ -2,19 +2,17 @@ public static partial class LzmaHelper { - public static byte[] Compress( - byte[] rawBytes) + public static byte[] Compress(byte[] rawBytes) { var outputStream = new MemoryStream(); Compress(new MemoryStream(rawBytes), outputStream); return outputStream.ToArray(); } - public static byte[] Decompress( - byte[] compressedBytes) + public static byte[] Decompress(byte[] compressedBytes) { var outputStream = new MemoryStream(); Decompress(new MemoryStream(compressedBytes), outputStream); return outputStream.ToArray(); } -} \ No newline at end of file +} diff --git a/src/Zaabee.LZMA/LZMA.Helper.Stream.Async.cs b/src/Zaabee.LZMA/LZMA.Helper.Stream.Async.cs index d3e57ed..66de61a 100644 --- a/src/Zaabee.LZMA/LZMA.Helper.Stream.Async.cs +++ b/src/Zaabee.LZMA/LZMA.Helper.Stream.Async.cs @@ -7,7 +7,8 @@ public static partial class LzmaHelper { public static async ValueTask CompressAsync( Stream inputStream, - CancellationToken cancellationToken = default) + CancellationToken cancellationToken = default + ) { var outputStream = new MemoryStream(); await CompressAsync(inputStream, outputStream, cancellationToken); @@ -16,7 +17,8 @@ public static async ValueTask CompressAsync( public static async ValueTask DecompressAsync( Stream inputStream, - CancellationToken cancellationToken = default) + CancellationToken cancellationToken = default + ) { var outputStream = new MemoryStream(); await DecompressAsync(inputStream, outputStream, cancellationToken); @@ -26,14 +28,20 @@ public static async ValueTask DecompressAsync( public static async ValueTask CompressAsync( Stream inputStream, Stream outputStream, - CancellationToken cancellationToken = default) + CancellationToken cancellationToken = default + ) { var encoder = new Encoder(); // Write the encoder properties encoder.WriteCoderProperties(outputStream); // Write the decompressed file size. - await outputStream.WriteAsync(BitConverter.GetBytes(inputStream.Length), 0, 8, cancellationToken); + await outputStream.WriteAsync( + BitConverter.GetBytes(inputStream.Length), + 0, + 8, + cancellationToken + ); // Encode encoder.Code(inputStream, outputStream, inputStream.Length, -1, null); @@ -45,7 +53,8 @@ public static async ValueTask CompressAsync( public static async ValueTask DecompressAsync( Stream inputStream, Stream outputStream, - CancellationToken cancellationToken = default) + CancellationToken cancellationToken = default + ) { var decoder = new Decoder(); // Read the decoder properties @@ -72,4 +81,4 @@ public static async ValueTask DecompressAsync( inputStream.TrySeek(0, SeekOrigin.Begin); outputStream.TrySeek(0, SeekOrigin.Begin); } -} \ No newline at end of file +} diff --git a/src/Zaabee.LZMA/LZMA.Helper.Stream.cs b/src/Zaabee.LZMA/LZMA.Helper.Stream.cs index 32dd0c5..1b23479 100644 --- a/src/Zaabee.LZMA/LZMA.Helper.Stream.cs +++ b/src/Zaabee.LZMA/LZMA.Helper.Stream.cs @@ -5,25 +5,21 @@ namespace Zaabee.LZMA; public static partial class LzmaHelper { - public static MemoryStream Compress( - Stream inputStream) + public static MemoryStream Compress(Stream inputStream) { var outputStream = new MemoryStream(); Compress(inputStream, outputStream); return outputStream; } - public static MemoryStream Decompress( - Stream inputStream) + public static MemoryStream Decompress(Stream inputStream) { var outputStream = new MemoryStream(); Decompress(inputStream, outputStream); return outputStream; } - public static void Compress( - Stream inputStream, - Stream outputStream) + public static void Compress(Stream inputStream, Stream outputStream) { var encoder = new Encoder(); encoder.WriteCoderProperties(outputStream); @@ -34,9 +30,7 @@ public static void Compress( outputStream.TrySeek(0, SeekOrigin.Begin); } - public static void Decompress( - Stream inputStream, - Stream outputStream) + public static void Decompress(Stream inputStream, Stream outputStream) { var decoder = new Decoder(); var properties = new byte[5]; @@ -53,4 +47,4 @@ public static void Decompress( inputStream.TrySeek(0, SeekOrigin.Begin); outputStream.TrySeek(0, SeekOrigin.Begin); } -} \ No newline at end of file +} diff --git a/src/Zaabee.LZMA/LZMA.Helper.String.cs b/src/Zaabee.LZMA/LZMA.Helper.String.cs index e0ef99f..05341ad 100644 --- a/src/Zaabee.LZMA/LZMA.Helper.String.cs +++ b/src/Zaabee.LZMA/LZMA.Helper.String.cs @@ -2,13 +2,9 @@ public static partial class LzmaHelper { - public static byte[] Compress( - string str, - Encoding? encoding = null) => + public static byte[] Compress(string str, Encoding? encoding = null) => Compress(str.GetBytes(encoding ?? Consts.DefaultEncoding)); - public static string DecompressToString( - byte[] compressedBytes, - Encoding? encoding = null) => + public static string DecompressToString(byte[] compressedBytes, Encoding? encoding = null) => Decompress(compressedBytes).GetString(encoding ?? Consts.DefaultEncoding); -} \ No newline at end of file +} diff --git a/src/Zaabee.LZMA/LzmaCompressor.cs b/src/Zaabee.LZMA/LzmaCompressor.cs index 095715e..d36d33b 100644 --- a/src/Zaabee.LZMA/LzmaCompressor.cs +++ b/src/Zaabee.LZMA/LzmaCompressor.cs @@ -4,45 +4,37 @@ public sealed class LzmaCompressor : ICompressor { public ValueTask CompressAsync( Stream rawStream, - CancellationToken cancellationToken = default) => - rawStream.ToLzmaAsync(cancellationToken: cancellationToken); + CancellationToken cancellationToken = default + ) => rawStream.ToLzmaAsync(cancellationToken: cancellationToken); public ValueTask DecompressAsync( Stream compressedStream, - CancellationToken cancellationToken = default) => - compressedStream.UnLzmaAsync(cancellationToken: cancellationToken); + CancellationToken cancellationToken = default + ) => compressedStream.UnLzmaAsync(cancellationToken: cancellationToken); public ValueTask CompressAsync( Stream inputStream, Stream outputStream, - CancellationToken cancellationToken = default) => - inputStream.ToLzmaAsync(outputStream, cancellationToken: cancellationToken); + CancellationToken cancellationToken = default + ) => inputStream.ToLzmaAsync(outputStream, cancellationToken: cancellationToken); public ValueTask DecompressAsync( Stream inputStream, Stream outputStream, - CancellationToken cancellationToken = default) => - inputStream.UnLzmaAsync(outputStream, cancellationToken: cancellationToken); + CancellationToken cancellationToken = default + ) => inputStream.UnLzmaAsync(outputStream, cancellationToken: cancellationToken); - public byte[] Compress(byte[] rawBytes) => - rawBytes.ToLzma(); + public byte[] Compress(byte[] rawBytes) => rawBytes.ToLzma(); - public byte[] Decompress(byte[] compressedBytes) => - compressedBytes.UnLzma(); + public byte[] Decompress(byte[] compressedBytes) => compressedBytes.UnLzma(); - public MemoryStream Compress(Stream rawStream) => - rawStream.ToLzma(); + public MemoryStream Compress(Stream rawStream) => rawStream.ToLzma(); - public MemoryStream Decompress(Stream compressedStream) => - compressedStream.UnLzma(); + public MemoryStream Decompress(Stream compressedStream) => compressedStream.UnLzma(); - public void Compress( - Stream inputStream, - Stream outputStream) => + public void Compress(Stream inputStream, Stream outputStream) => inputStream.ToLzma(outputStream); - public void Decompress( - Stream inputStream, - Stream outputStream) => + public void Decompress(Stream inputStream, Stream outputStream) => inputStream.UnLzma(outputStream); -} \ No newline at end of file +} diff --git a/src/Zaabee.SharpZipLib/BZip2.Extensions.Bytes.cs b/src/Zaabee.SharpZipLib/BZip2.Extensions.Bytes.cs index 89d74e0..96d21b7 100644 --- a/src/Zaabee.SharpZipLib/BZip2.Extensions.Bytes.cs +++ b/src/Zaabee.SharpZipLib/BZip2.Extensions.Bytes.cs @@ -2,9 +2,8 @@ public static partial class Bzip2Extensions { - public static byte[] ToBZip2(this byte[] rawBytes) => - Bzip2Helper.Compress(rawBytes); + public static byte[] ToBZip2(this byte[] rawBytes) => Bzip2Helper.Compress(rawBytes); public static byte[] UnBZip2(this byte[] compressedBytes) => Bzip2Helper.Decompress(compressedBytes); -} \ No newline at end of file +} diff --git a/src/Zaabee.SharpZipLib/BZip2.Extensions.Stream.Async.cs b/src/Zaabee.SharpZipLib/BZip2.Extensions.Stream.Async.cs index 1f3269e..8175f53 100644 --- a/src/Zaabee.SharpZipLib/BZip2.Extensions.Stream.Async.cs +++ b/src/Zaabee.SharpZipLib/BZip2.Extensions.Stream.Async.cs @@ -5,22 +5,22 @@ public static partial class Bzip2Extensions public static ValueTask ToBZip2Async( this Stream rawStream, Stream outputStream, - CancellationToken cancellationToken = default) => - Bzip2Helper.CompressAsync(rawStream, outputStream, cancellationToken); + CancellationToken cancellationToken = default + ) => Bzip2Helper.CompressAsync(rawStream, outputStream, cancellationToken); public static ValueTask UnBZip2Async( this Stream compressedStream, Stream outputStream, - CancellationToken cancellationToken = default) => - Bzip2Helper.DecompressAsync(compressedStream, outputStream, cancellationToken); + CancellationToken cancellationToken = default + ) => Bzip2Helper.DecompressAsync(compressedStream, outputStream, cancellationToken); public static ValueTask ToBZip2Async( this Stream rawStream, - CancellationToken cancellationToken = default) => - Bzip2Helper.CompressAsync(rawStream, cancellationToken); + CancellationToken cancellationToken = default + ) => Bzip2Helper.CompressAsync(rawStream, cancellationToken); public static ValueTask UnBZip2Async( this Stream compressedStream, - CancellationToken cancellationToken = default) => - Bzip2Helper.DecompressAsync(compressedStream, cancellationToken); -} \ No newline at end of file + CancellationToken cancellationToken = default + ) => Bzip2Helper.DecompressAsync(compressedStream, cancellationToken); +} diff --git a/src/Zaabee.SharpZipLib/BZip2.Extensions.Stream.cs b/src/Zaabee.SharpZipLib/BZip2.Extensions.Stream.cs index 0e52f01..0a0fd98 100644 --- a/src/Zaabee.SharpZipLib/BZip2.Extensions.Stream.cs +++ b/src/Zaabee.SharpZipLib/BZip2.Extensions.Stream.cs @@ -2,19 +2,14 @@ public static partial class Bzip2Extensions { - public static void ToBZip2( - this Stream rawStream, - Stream outputStream) => + public static void ToBZip2(this Stream rawStream, Stream outputStream) => Bzip2Helper.Compress(rawStream, outputStream); - public static void UnBZip2( - this Stream compressedStream, - Stream outputStream) => + public static void UnBZip2(this Stream compressedStream, Stream outputStream) => Bzip2Helper.Decompress(compressedStream, outputStream); - public static MemoryStream ToBZip2(this Stream rawStream) => - Bzip2Helper.Compress(rawStream); + public static MemoryStream ToBZip2(this Stream rawStream) => Bzip2Helper.Compress(rawStream); public static MemoryStream UnBZip2(this Stream compressedStream) => Bzip2Helper.Decompress(compressedStream); -} \ No newline at end of file +} diff --git a/src/Zaabee.SharpZipLib/BZip2.Extensions.String.cs b/src/Zaabee.SharpZipLib/BZip2.Extensions.String.cs index ea29abf..af64bf3 100644 --- a/src/Zaabee.SharpZipLib/BZip2.Extensions.String.cs +++ b/src/Zaabee.SharpZipLib/BZip2.Extensions.String.cs @@ -2,13 +2,9 @@ public static partial class Bzip2Extensions { - public static byte[] ToBZip2( - this string str, - Encoding? encoding = null) => + public static byte[] ToBZip2(this string str, Encoding? encoding = null) => Bzip2Helper.Compress(str, encoding); - public static string UnBZip2ToString( - this byte[] compressedBytes, - Encoding? encoding = null) => + public static string UnBZip2ToString(this byte[] compressedBytes, Encoding? encoding = null) => Bzip2Helper.DecompressToString(compressedBytes, encoding); -} \ No newline at end of file +} diff --git a/src/Zaabee.SharpZipLib/BZip2.Helper.Bytes.cs b/src/Zaabee.SharpZipLib/BZip2.Helper.Bytes.cs index ffdcdb4..9338e83 100644 --- a/src/Zaabee.SharpZipLib/BZip2.Helper.Bytes.cs +++ b/src/Zaabee.SharpZipLib/BZip2.Helper.Bytes.cs @@ -17,4 +17,4 @@ public static byte[] Decompress(byte[] compressedBytes) bzip2InputStream.CopyTo(outputStream); return outputStream.ToArray(); } -} \ No newline at end of file +} diff --git a/src/Zaabee.SharpZipLib/BZip2.Helper.Stream.Async.cs b/src/Zaabee.SharpZipLib/BZip2.Helper.Stream.Async.cs index a913341..d81bf0e 100644 --- a/src/Zaabee.SharpZipLib/BZip2.Helper.Stream.Async.cs +++ b/src/Zaabee.SharpZipLib/BZip2.Helper.Stream.Async.cs @@ -4,7 +4,8 @@ public static partial class Bzip2Helper { public static async ValueTask CompressAsync( Stream inputStream, - CancellationToken cancellationToken = default) + CancellationToken cancellationToken = default + ) { var outputStream = new MemoryStream(); await CompressAsync(inputStream, outputStream, cancellationToken); @@ -13,7 +14,8 @@ public static async ValueTask CompressAsync( public static async ValueTask DecompressAsync( Stream inputStream, - CancellationToken cancellationToken = default) + CancellationToken cancellationToken = default + ) { var outputStream = new MemoryStream(); await DecompressAsync(inputStream, outputStream, cancellationToken); @@ -23,7 +25,8 @@ public static async ValueTask DecompressAsync( public static async ValueTask CompressAsync( Stream inputStream, Stream outputStream, - CancellationToken cancellationToken = default) + CancellationToken cancellationToken = default + ) { #if NETSTANDARD2_0 using (var bzip2OutputStream = new BZip2OutputStream(outputStream)) @@ -43,7 +46,8 @@ public static async ValueTask CompressAsync( public static async ValueTask DecompressAsync( Stream inputStream, Stream outputStream, - CancellationToken cancellationToken = default) + CancellationToken cancellationToken = default + ) { #if NETSTANDARD2_0 using (var bzip2InputStream = new BZip2InputStream(inputStream)) @@ -59,4 +63,4 @@ public static async ValueTask DecompressAsync( inputStream.TrySeek(0, SeekOrigin.Begin); outputStream.TrySeek(0, SeekOrigin.Begin); } -} \ No newline at end of file +} diff --git a/src/Zaabee.SharpZipLib/BZip2.Helper.Stream.cs b/src/Zaabee.SharpZipLib/BZip2.Helper.Stream.cs index 3939f30..65453eb 100644 --- a/src/Zaabee.SharpZipLib/BZip2.Helper.Stream.cs +++ b/src/Zaabee.SharpZipLib/BZip2.Helper.Stream.cs @@ -2,25 +2,21 @@ public static partial class Bzip2Helper { - public static MemoryStream Compress( - Stream inputStream) + public static MemoryStream Compress(Stream inputStream) { var outputStream = new MemoryStream(); Compress(inputStream, outputStream); return outputStream; } - public static MemoryStream Decompress( - Stream inputStream) + public static MemoryStream Decompress(Stream inputStream) { var outputStream = new MemoryStream(); Decompress(inputStream, outputStream); return outputStream; } - public static void Compress( - Stream inputStream, - Stream outputStream) + public static void Compress(Stream inputStream, Stream outputStream) { using (var bzip2OutputStream = new BZip2OutputStream(outputStream)) { @@ -31,9 +27,7 @@ public static void Compress( outputStream.TrySeek(0, SeekOrigin.Begin); } - public static void Decompress( - Stream inputStream, - Stream outputStream) + public static void Decompress(Stream inputStream, Stream outputStream) { using (var bzip2InputStream = new BZip2InputStream(inputStream)) { @@ -43,4 +37,4 @@ public static void Decompress( inputStream.TrySeek(0, SeekOrigin.Begin); outputStream.TrySeek(0, SeekOrigin.Begin); } -} \ No newline at end of file +} diff --git a/src/Zaabee.SharpZipLib/BZip2.Helper.String.cs b/src/Zaabee.SharpZipLib/BZip2.Helper.String.cs index f2fd7ea..5033673 100644 --- a/src/Zaabee.SharpZipLib/BZip2.Helper.String.cs +++ b/src/Zaabee.SharpZipLib/BZip2.Helper.String.cs @@ -2,13 +2,9 @@ public static partial class Bzip2Helper { - public static byte[] Compress( - string str, - Encoding? encoding = null) => + public static byte[] Compress(string str, Encoding? encoding = null) => Compress(str.GetBytes(encoding ?? Consts.DefaultEncoding)); - public static string DecompressToString( - byte[] compressedBytes, - Encoding? encoding = null) => + public static string DecompressToString(byte[] compressedBytes, Encoding? encoding = null) => Decompress(compressedBytes).GetString(encoding ?? Consts.DefaultEncoding); -} \ No newline at end of file +} diff --git a/src/Zaabee.SharpZipLib/Bzip2Compressor.cs b/src/Zaabee.SharpZipLib/Bzip2Compressor.cs index 54662d4..4fbda53 100644 --- a/src/Zaabee.SharpZipLib/Bzip2Compressor.cs +++ b/src/Zaabee.SharpZipLib/Bzip2Compressor.cs @@ -4,45 +4,37 @@ public sealed class Bzip2Compressor : ICompressor { public ValueTask CompressAsync( Stream rawStream, - CancellationToken cancellationToken = default) => - rawStream.ToBZip2Async(cancellationToken); + CancellationToken cancellationToken = default + ) => rawStream.ToBZip2Async(cancellationToken); public ValueTask DecompressAsync( Stream compressedStream, - CancellationToken cancellationToken = default) => - compressedStream.UnBZip2Async(cancellationToken); + CancellationToken cancellationToken = default + ) => compressedStream.UnBZip2Async(cancellationToken); public ValueTask CompressAsync( Stream inputStream, Stream outputStream, - CancellationToken cancellationToken = default) => - inputStream.ToBZip2Async(outputStream, cancellationToken); + CancellationToken cancellationToken = default + ) => inputStream.ToBZip2Async(outputStream, cancellationToken); public ValueTask DecompressAsync( Stream inputStream, Stream outputStream, - CancellationToken cancellationToken = default) => - inputStream.UnBZip2Async(outputStream, cancellationToken); + CancellationToken cancellationToken = default + ) => inputStream.UnBZip2Async(outputStream, cancellationToken); - public byte[] Compress(byte[] rawBytes) => - rawBytes.ToBZip2(); + public byte[] Compress(byte[] rawBytes) => rawBytes.ToBZip2(); - public byte[] Decompress(byte[] compressedBytes) => - compressedBytes.UnBZip2(); + public byte[] Decompress(byte[] compressedBytes) => compressedBytes.UnBZip2(); - public MemoryStream Compress(Stream rawStream) => - rawStream.ToBZip2(); + public MemoryStream Compress(Stream rawStream) => rawStream.ToBZip2(); - public MemoryStream Decompress(Stream compressedStream) => - compressedStream.UnBZip2(); + public MemoryStream Decompress(Stream compressedStream) => compressedStream.UnBZip2(); - public void Compress( - Stream inputStream, - Stream outputStream) => + public void Compress(Stream inputStream, Stream outputStream) => inputStream.ToBZip2(outputStream); - public void Decompress( - Stream inputStream, - Stream outputStream) => + public void Decompress(Stream inputStream, Stream outputStream) => inputStream.UnBZip2(outputStream); -} \ No newline at end of file +} diff --git a/src/Zaabee.SharpZipLib/GZip.Extensions.Bytes.cs b/src/Zaabee.SharpZipLib/GZip.Extensions.Bytes.cs index 2df85de..1b26959 100644 --- a/src/Zaabee.SharpZipLib/GZip.Extensions.Bytes.cs +++ b/src/Zaabee.SharpZipLib/GZip.Extensions.Bytes.cs @@ -2,9 +2,8 @@ public static partial class GzipExtensions { - public static byte[] ToGZip(this byte[] rawBytes) => - GzipHelper.Compress(rawBytes); + public static byte[] ToGZip(this byte[] rawBytes) => GzipHelper.Compress(rawBytes); public static byte[] UnGZip(this byte[] compressedBytes) => GzipHelper.Decompress(compressedBytes); -} \ No newline at end of file +} diff --git a/src/Zaabee.SharpZipLib/GZip.Extensions.Stream.Async.cs b/src/Zaabee.SharpZipLib/GZip.Extensions.Stream.Async.cs index 1fd8a12..57ff47f 100644 --- a/src/Zaabee.SharpZipLib/GZip.Extensions.Stream.Async.cs +++ b/src/Zaabee.SharpZipLib/GZip.Extensions.Stream.Async.cs @@ -5,22 +5,22 @@ public static partial class GzipExtensions public static ValueTask ToGZipAsync( this Stream rawStream, Stream outputStream, - CancellationToken cancellationToken = default) => - GzipHelper.CompressAsync(rawStream, outputStream, cancellationToken); + CancellationToken cancellationToken = default + ) => GzipHelper.CompressAsync(rawStream, outputStream, cancellationToken); public static ValueTask UnGZipAsync( this Stream compressedStream, Stream outputStream, - CancellationToken cancellationToken = default) => - GzipHelper.DecompressAsync(compressedStream, outputStream, cancellationToken); + CancellationToken cancellationToken = default + ) => GzipHelper.DecompressAsync(compressedStream, outputStream, cancellationToken); public static ValueTask ToGZipAsync( this Stream rawStream, - CancellationToken cancellationToken = default) => - GzipHelper.CompressAsync(rawStream, cancellationToken); + CancellationToken cancellationToken = default + ) => GzipHelper.CompressAsync(rawStream, cancellationToken); public static ValueTask UnGZipAsync( this Stream compressedStream, - CancellationToken cancellationToken = default) => - GzipHelper.DecompressAsync(compressedStream, cancellationToken); -} \ No newline at end of file + CancellationToken cancellationToken = default + ) => GzipHelper.DecompressAsync(compressedStream, cancellationToken); +} diff --git a/src/Zaabee.SharpZipLib/GZip.Extensions.Stream.cs b/src/Zaabee.SharpZipLib/GZip.Extensions.Stream.cs index 4f5a405..682b3f3 100644 --- a/src/Zaabee.SharpZipLib/GZip.Extensions.Stream.cs +++ b/src/Zaabee.SharpZipLib/GZip.Extensions.Stream.cs @@ -2,19 +2,14 @@ public static partial class GzipExtensions { - public static void ToGZip( - this Stream rawStream, - Stream outputStream) => + public static void ToGZip(this Stream rawStream, Stream outputStream) => GzipHelper.Compress(rawStream, outputStream); - public static void UnGZip( - this Stream compressedStream, - Stream outputStream) => + public static void UnGZip(this Stream compressedStream, Stream outputStream) => GzipHelper.Decompress(compressedStream, outputStream); - public static MemoryStream ToGZip(this Stream rawStream) => - GzipHelper.Compress(rawStream); + public static MemoryStream ToGZip(this Stream rawStream) => GzipHelper.Compress(rawStream); public static MemoryStream UnGZip(this Stream compressedStream) => GzipHelper.Decompress(compressedStream); -} \ No newline at end of file +} diff --git a/src/Zaabee.SharpZipLib/GZip.Extensions.String.cs b/src/Zaabee.SharpZipLib/GZip.Extensions.String.cs index 63997e2..d55a6b9 100644 --- a/src/Zaabee.SharpZipLib/GZip.Extensions.String.cs +++ b/src/Zaabee.SharpZipLib/GZip.Extensions.String.cs @@ -2,13 +2,9 @@ public static partial class GzipExtensions { - public static byte[] ToGZip( - this string str, - Encoding? encoding = null) => + public static byte[] ToGZip(this string str, Encoding? encoding = null) => GzipHelper.Compress(str, encoding); - public static string UnGZipToString( - this byte[] compressedBytes, - Encoding? encoding = null) => + public static string UnGZipToString(this byte[] compressedBytes, Encoding? encoding = null) => GzipHelper.DecompressToString(compressedBytes, encoding); -} \ No newline at end of file +} diff --git a/src/Zaabee.SharpZipLib/GZip.Helper.Bytes.cs b/src/Zaabee.SharpZipLib/GZip.Helper.Bytes.cs index 58f13c2..6adcb78 100644 --- a/src/Zaabee.SharpZipLib/GZip.Helper.Bytes.cs +++ b/src/Zaabee.SharpZipLib/GZip.Helper.Bytes.cs @@ -17,4 +17,4 @@ public static byte[] Decompress(byte[] compressedBytes) gzipInputStream.CopyTo(outputStream); return outputStream.ToArray(); } -} \ No newline at end of file +} diff --git a/src/Zaabee.SharpZipLib/GZip.Helper.Stream.Async.cs b/src/Zaabee.SharpZipLib/GZip.Helper.Stream.Async.cs index 120d59d..bfadc36 100644 --- a/src/Zaabee.SharpZipLib/GZip.Helper.Stream.Async.cs +++ b/src/Zaabee.SharpZipLib/GZip.Helper.Stream.Async.cs @@ -4,7 +4,8 @@ public static partial class GzipHelper { public static async ValueTask CompressAsync( Stream inputStream, - CancellationToken cancellationToken = default) + CancellationToken cancellationToken = default + ) { var outputStream = new MemoryStream(); await CompressAsync(inputStream, outputStream, cancellationToken); @@ -13,7 +14,8 @@ public static async ValueTask CompressAsync( public static async ValueTask DecompressAsync( Stream inputStream, - CancellationToken cancellationToken = default) + CancellationToken cancellationToken = default + ) { var outputStream = new MemoryStream(); await DecompressAsync(inputStream, outputStream, cancellationToken); @@ -23,7 +25,8 @@ public static async ValueTask DecompressAsync( public static async ValueTask CompressAsync( Stream inputStream, Stream outputStream, - CancellationToken cancellationToken = default) + CancellationToken cancellationToken = default + ) { #if NETSTANDARD2_0 using (var gzipOutputStream = new GZipOutputStream(outputStream)) @@ -43,7 +46,8 @@ public static async ValueTask CompressAsync( public static async ValueTask DecompressAsync( Stream inputStream, Stream outputStream, - CancellationToken cancellationToken = default) + CancellationToken cancellationToken = default + ) { #if NETSTANDARD2_0 using (var gzipInputStream = new GZipInputStream(inputStream)) @@ -59,4 +63,4 @@ public static async ValueTask DecompressAsync( inputStream.TrySeek(0, SeekOrigin.Begin); outputStream.TrySeek(0, SeekOrigin.Begin); } -} \ No newline at end of file +} diff --git a/src/Zaabee.SharpZipLib/GZip.Helper.Stream.cs b/src/Zaabee.SharpZipLib/GZip.Helper.Stream.cs index 3a3979c..ba9e295 100644 --- a/src/Zaabee.SharpZipLib/GZip.Helper.Stream.cs +++ b/src/Zaabee.SharpZipLib/GZip.Helper.Stream.cs @@ -2,25 +2,21 @@ public static partial class GzipHelper { - public static MemoryStream Compress( - Stream inputStream) + public static MemoryStream Compress(Stream inputStream) { var outputStream = new MemoryStream(); Compress(inputStream, outputStream); return outputStream; } - public static MemoryStream Decompress( - Stream inputStream) + public static MemoryStream Decompress(Stream inputStream) { var outputStream = new MemoryStream(); Decompress(inputStream, outputStream); return outputStream; } - public static void Compress( - Stream inputStream, - Stream outputStream) + public static void Compress(Stream inputStream, Stream outputStream) { using (var gzipOutputStream = new GZipOutputStream(outputStream)) { @@ -31,9 +27,7 @@ public static void Compress( outputStream.TrySeek(0, SeekOrigin.Begin); } - public static void Decompress( - Stream inputStream, - Stream outputStream) + public static void Decompress(Stream inputStream, Stream outputStream) { using (var gzipInputStream = new GZipInputStream(inputStream)) { @@ -43,4 +37,4 @@ public static void Decompress( inputStream.TrySeek(0, SeekOrigin.Begin); outputStream.TrySeek(0, SeekOrigin.Begin); } -} \ No newline at end of file +} diff --git a/src/Zaabee.SharpZipLib/GZip.Helper.String.cs b/src/Zaabee.SharpZipLib/GZip.Helper.String.cs index 07fe691..45c95c3 100644 --- a/src/Zaabee.SharpZipLib/GZip.Helper.String.cs +++ b/src/Zaabee.SharpZipLib/GZip.Helper.String.cs @@ -2,13 +2,9 @@ public static partial class GzipHelper { - public static byte[] Compress( - string str, - Encoding? encoding = null) => + public static byte[] Compress(string str, Encoding? encoding = null) => Compress(str.GetBytes(encoding ?? Consts.DefaultEncoding)); - public static string DecompressToString( - byte[] compressedBytes, - Encoding? encoding = null) => + public static string DecompressToString(byte[] compressedBytes, Encoding? encoding = null) => Decompress(compressedBytes).GetString(encoding ?? Consts.DefaultEncoding); -} \ No newline at end of file +} diff --git a/src/Zaabee.SharpZipLib/GlobalUsings.cs b/src/Zaabee.SharpZipLib/GlobalUsings.cs index bebbd18..9bd4e06 100644 --- a/src/Zaabee.SharpZipLib/GlobalUsings.cs +++ b/src/Zaabee.SharpZipLib/GlobalUsings.cs @@ -6,4 +6,4 @@ global using ICSharpCode.SharpZipLib.BZip2; global using ICSharpCode.SharpZipLib.GZip; global using Zaabee.Compressor.Abstractions; -global using Zaabee.Extensions; \ No newline at end of file +global using Zaabee.Extensions; diff --git a/src/Zaabee.SharpZipLib/GzipCompressor.cs b/src/Zaabee.SharpZipLib/GzipCompressor.cs index e049a97..eb5a90a 100644 --- a/src/Zaabee.SharpZipLib/GzipCompressor.cs +++ b/src/Zaabee.SharpZipLib/GzipCompressor.cs @@ -4,45 +4,37 @@ public sealed class GzipCompressor : ICompressor { public ValueTask CompressAsync( Stream rawStream, - CancellationToken cancellationToken = default) => - rawStream.ToGZipAsync(cancellationToken); + CancellationToken cancellationToken = default + ) => rawStream.ToGZipAsync(cancellationToken); public ValueTask DecompressAsync( Stream compressedStream, - CancellationToken cancellationToken = default) => - compressedStream.UnGZipAsync(cancellationToken); + CancellationToken cancellationToken = default + ) => compressedStream.UnGZipAsync(cancellationToken); public ValueTask CompressAsync( Stream inputStream, Stream outputStream, - CancellationToken cancellationToken = default) => - inputStream.ToGZipAsync(outputStream, cancellationToken); + CancellationToken cancellationToken = default + ) => inputStream.ToGZipAsync(outputStream, cancellationToken); public ValueTask DecompressAsync( Stream inputStream, Stream outputStream, - CancellationToken cancellationToken = default) => - inputStream.UnGZipAsync(outputStream, cancellationToken); + CancellationToken cancellationToken = default + ) => inputStream.UnGZipAsync(outputStream, cancellationToken); - public byte[] Compress(byte[] rawBytes) => - rawBytes.ToGZip(); + public byte[] Compress(byte[] rawBytes) => rawBytes.ToGZip(); - public byte[] Decompress(byte[] compressedBytes) => - compressedBytes.UnGZip(); + public byte[] Decompress(byte[] compressedBytes) => compressedBytes.UnGZip(); - public MemoryStream Compress(Stream rawStream) => - rawStream.ToGZip(); + public MemoryStream Compress(Stream rawStream) => rawStream.ToGZip(); - public MemoryStream Decompress(Stream compressedStream) => - compressedStream.UnGZip(); + public MemoryStream Decompress(Stream compressedStream) => compressedStream.UnGZip(); - public void Compress( - Stream inputStream, - Stream outputStream) => + public void Compress(Stream inputStream, Stream outputStream) => inputStream.ToGZip(outputStream); - public void Decompress( - Stream inputStream, - Stream outputStream) => + public void Decompress(Stream inputStream, Stream outputStream) => inputStream.UnGZip(outputStream); -} \ No newline at end of file +} diff --git a/src/Zaabee.Snappy/GlobalUsings.cs b/src/Zaabee.Snappy/GlobalUsings.cs index 86837eb..63bdfce 100644 --- a/src/Zaabee.Snappy/GlobalUsings.cs +++ b/src/Zaabee.Snappy/GlobalUsings.cs @@ -2,4 +2,4 @@ global using System.Text; global using Zaabee.Compressor.Abstractions; -global using Zaabee.Extensions; \ No newline at end of file +global using Zaabee.Extensions; diff --git a/src/Zaabee.Snappy/Snappy.Extensions.Bytes.cs b/src/Zaabee.Snappy/Snappy.Extensions.Bytes.cs index 444b76b..c8b55a1 100644 --- a/src/Zaabee.Snappy/Snappy.Extensions.Bytes.cs +++ b/src/Zaabee.Snappy/Snappy.Extensions.Bytes.cs @@ -2,11 +2,8 @@ public static partial class SnappyExtensions { - public static byte[] ToSnappy( - this byte[] rawBytes) => - SnappyHelper.Compress(rawBytes); + public static byte[] ToSnappy(this byte[] rawBytes) => SnappyHelper.Compress(rawBytes); - public static byte[] UnSnappy( - this byte[] compressedBytes) => + public static byte[] UnSnappy(this byte[] compressedBytes) => SnappyHelper.Decompress(compressedBytes); -} \ No newline at end of file +} diff --git a/src/Zaabee.Snappy/Snappy.Extensions.Stream.Async.cs b/src/Zaabee.Snappy/Snappy.Extensions.Stream.Async.cs index 3d14319..91dbe2d 100644 --- a/src/Zaabee.Snappy/Snappy.Extensions.Stream.Async.cs +++ b/src/Zaabee.Snappy/Snappy.Extensions.Stream.Async.cs @@ -5,22 +5,22 @@ public static partial class SnappyExtensions public static ValueTask ToSnappyAsync( this Stream rawStream, Stream outputStream, - CancellationToken cancellationToken = default) => - SnappyHelper.CompressAsync(rawStream, outputStream, cancellationToken); + CancellationToken cancellationToken = default + ) => SnappyHelper.CompressAsync(rawStream, outputStream, cancellationToken); public static ValueTask UnSnappyAsync( this Stream compressedStream, Stream outputStream, - CancellationToken cancellationToken = default) => - SnappyHelper.DecompressAsync(compressedStream, outputStream, cancellationToken); + CancellationToken cancellationToken = default + ) => SnappyHelper.DecompressAsync(compressedStream, outputStream, cancellationToken); public static ValueTask ToSnappyAsync( this Stream rawStream, - CancellationToken cancellationToken = default) => - SnappyHelper.CompressAsync(rawStream, cancellationToken); + CancellationToken cancellationToken = default + ) => SnappyHelper.CompressAsync(rawStream, cancellationToken); public static ValueTask UnSnappyAsync( this Stream compressedStream, - CancellationToken cancellationToken = default) => - SnappyHelper.DecompressAsync(compressedStream, cancellationToken); -} \ No newline at end of file + CancellationToken cancellationToken = default + ) => SnappyHelper.DecompressAsync(compressedStream, cancellationToken); +} diff --git a/src/Zaabee.Snappy/Snappy.Extensions.Stream.cs b/src/Zaabee.Snappy/Snappy.Extensions.Stream.cs index ac2faa2..767e5de 100644 --- a/src/Zaabee.Snappy/Snappy.Extensions.Stream.cs +++ b/src/Zaabee.Snappy/Snappy.Extensions.Stream.cs @@ -2,21 +2,14 @@ public static partial class SnappyExtensions { - public static void ToSnappy( - this Stream rawStream, - Stream outputStream) => + public static void ToSnappy(this Stream rawStream, Stream outputStream) => SnappyHelper.Compress(rawStream, outputStream); - public static void UnSnappy( - this Stream compressedStream, - Stream outputStream) => + public static void UnSnappy(this Stream compressedStream, Stream outputStream) => SnappyHelper.Decompress(compressedStream, outputStream); - public static MemoryStream ToSnappy( - this Stream rawStream) => - SnappyHelper.Compress(rawStream); + public static MemoryStream ToSnappy(this Stream rawStream) => SnappyHelper.Compress(rawStream); - public static MemoryStream UnSnappy( - this Stream compressedStream) => + public static MemoryStream UnSnappy(this Stream compressedStream) => SnappyHelper.Decompress(compressedStream); -} \ No newline at end of file +} diff --git a/src/Zaabee.Snappy/Snappy.Extensions.String.cs b/src/Zaabee.Snappy/Snappy.Extensions.String.cs index 736a32b..164d56f 100644 --- a/src/Zaabee.Snappy/Snappy.Extensions.String.cs +++ b/src/Zaabee.Snappy/Snappy.Extensions.String.cs @@ -2,13 +2,9 @@ public static partial class SnappyExtensions { - public static byte[] ToSnappy( - this string str, - Encoding? encoding = null) => + public static byte[] ToSnappy(this string str, Encoding? encoding = null) => SnappyHelper.Compress(str, encoding); - public static string UnSnappyToString( - this byte[] compressedBytes, - Encoding? encoding = null) => + public static string UnSnappyToString(this byte[] compressedBytes, Encoding? encoding = null) => SnappyHelper.DecompressToString(compressedBytes, encoding); -} \ No newline at end of file +} diff --git a/src/Zaabee.Snappy/Snappy.Helper.Bytes.cs b/src/Zaabee.Snappy/Snappy.Helper.Bytes.cs index 30e1f16..ae49e0f 100644 --- a/src/Zaabee.Snappy/Snappy.Helper.Bytes.cs +++ b/src/Zaabee.Snappy/Snappy.Helper.Bytes.cs @@ -2,11 +2,8 @@ public static partial class SnappyHelper { - public static byte[] Compress( - byte[] rawBytes) => - IronSnappy.Snappy.Encode(rawBytes); + public static byte[] Compress(byte[] rawBytes) => IronSnappy.Snappy.Encode(rawBytes); - public static byte[] Decompress( - byte[] compressedBytes) => + public static byte[] Decompress(byte[] compressedBytes) => IronSnappy.Snappy.Decode(compressedBytes); -} \ No newline at end of file +} diff --git a/src/Zaabee.Snappy/Snappy.Helper.Stream.Async.cs b/src/Zaabee.Snappy/Snappy.Helper.Stream.Async.cs index 644e978..922385b 100644 --- a/src/Zaabee.Snappy/Snappy.Helper.Stream.Async.cs +++ b/src/Zaabee.Snappy/Snappy.Helper.Stream.Async.cs @@ -4,7 +4,8 @@ public static partial class SnappyHelper { public static async ValueTask CompressAsync( Stream inputStream, - CancellationToken cancellationToken = default) + CancellationToken cancellationToken = default + ) { var rawBytes = await inputStream.ReadToEndAsync(cancellationToken); var compressedBytes = IronSnappy.Snappy.Encode(rawBytes); @@ -14,7 +15,8 @@ public static async ValueTask CompressAsync( public static async ValueTask DecompressAsync( Stream inputStream, - CancellationToken cancellationToken = default) + CancellationToken cancellationToken = default + ) { var compressedBytes = await inputStream.ReadToEndAsync(cancellationToken); var rawBytes = IronSnappy.Snappy.Decode(compressedBytes); @@ -25,12 +27,18 @@ public static async ValueTask DecompressAsync( public static async ValueTask CompressAsync( Stream inputStream, Stream outputStream, - CancellationToken cancellationToken = default) + CancellationToken cancellationToken = default + ) { var rawBytes = await inputStream.ReadToEndAsync(cancellationToken); var compressedBytes = IronSnappy.Snappy.Encode(rawBytes); #if NETSTANDARD2_0 - await outputStream.WriteAsync(compressedBytes, 0, compressedBytes.Length, cancellationToken); + await outputStream.WriteAsync( + compressedBytes, + 0, + compressedBytes.Length, + cancellationToken + ); #else await outputStream.WriteAsync(compressedBytes, cancellationToken); #endif @@ -41,7 +49,8 @@ public static async ValueTask CompressAsync( public static async ValueTask DecompressAsync( Stream inputStream, Stream outputStream, - CancellationToken cancellationToken = default) + CancellationToken cancellationToken = default + ) { var compressedBytes = await inputStream.ReadToEndAsync(cancellationToken); var rawBytes = IronSnappy.Snappy.Decode(compressedBytes); @@ -53,4 +62,4 @@ public static async ValueTask DecompressAsync( inputStream.TrySeek(0, SeekOrigin.Begin); outputStream.TrySeek(0, SeekOrigin.Begin); } -} \ No newline at end of file +} diff --git a/src/Zaabee.Snappy/Snappy.Helper.Stream.cs b/src/Zaabee.Snappy/Snappy.Helper.Stream.cs index 0ff6017..6caa49c 100644 --- a/src/Zaabee.Snappy/Snappy.Helper.Stream.cs +++ b/src/Zaabee.Snappy/Snappy.Helper.Stream.cs @@ -2,8 +2,7 @@ public static partial class SnappyHelper { - public static MemoryStream Compress( - Stream inputStream) + public static MemoryStream Compress(Stream inputStream) { var rawBytes = inputStream.ReadToEnd(); var compressedBytes = IronSnappy.Snappy.Encode(rawBytes); @@ -11,8 +10,7 @@ public static MemoryStream Compress( return new MemoryStream(compressedBytes); } - public static MemoryStream Decompress( - Stream inputStream) + public static MemoryStream Decompress(Stream inputStream) { var compressedBytes = inputStream.ReadToEnd(); var rawBytes = IronSnappy.Snappy.Decode(compressedBytes); @@ -20,9 +18,7 @@ public static MemoryStream Decompress( return new MemoryStream(rawBytes); } - public static void Compress( - Stream inputStream, - Stream outputStream) + public static void Compress(Stream inputStream, Stream outputStream) { var rawBytes = inputStream.ReadToEnd(); var compressedBytes = IronSnappy.Snappy.Encode(rawBytes); @@ -31,9 +27,7 @@ public static void Compress( outputStream.TrySeek(0, SeekOrigin.Begin); } - public static void Decompress( - Stream inputStream, - Stream outputStream) + public static void Decompress(Stream inputStream, Stream outputStream) { var compressedBytes = inputStream.ReadToEnd(); var rawBytes = IronSnappy.Snappy.Decode(compressedBytes); @@ -41,4 +35,4 @@ public static void Decompress( inputStream.TrySeek(0, SeekOrigin.Begin); outputStream.TrySeek(0, SeekOrigin.Begin); } -} \ No newline at end of file +} diff --git a/src/Zaabee.Snappy/Snappy.Helper.String.cs b/src/Zaabee.Snappy/Snappy.Helper.String.cs index 74ef5df..7726fa3 100644 --- a/src/Zaabee.Snappy/Snappy.Helper.String.cs +++ b/src/Zaabee.Snappy/Snappy.Helper.String.cs @@ -2,14 +2,9 @@ public static partial class SnappyHelper { - public static byte[] Compress( - string str, - Encoding? encoding = null) => + public static byte[] Compress(string str, Encoding? encoding = null) => Compress(str.GetBytes(encoding ?? Consts.DefaultEncoding)); - public static string DecompressToString( - byte[] compressedBytes, - Encoding? encoding = null) => - Decompress(compressedBytes) - .GetString(encoding ?? Consts.DefaultEncoding); -} \ No newline at end of file + public static string DecompressToString(byte[] compressedBytes, Encoding? encoding = null) => + Decompress(compressedBytes).GetString(encoding ?? Consts.DefaultEncoding); +} diff --git a/src/Zaabee.Snappy/SnappyCompressor.cs b/src/Zaabee.Snappy/SnappyCompressor.cs index 641a297..26071ea 100644 --- a/src/Zaabee.Snappy/SnappyCompressor.cs +++ b/src/Zaabee.Snappy/SnappyCompressor.cs @@ -4,45 +4,37 @@ public sealed class SnappyCompressor : ICompressor { public ValueTask CompressAsync( Stream rawStream, - CancellationToken cancellationToken = default) => - rawStream.ToSnappyAsync(cancellationToken); + CancellationToken cancellationToken = default + ) => rawStream.ToSnappyAsync(cancellationToken); public ValueTask DecompressAsync( Stream compressedStream, - CancellationToken cancellationToken = default) => - compressedStream.UnSnappyAsync(cancellationToken); + CancellationToken cancellationToken = default + ) => compressedStream.UnSnappyAsync(cancellationToken); public ValueTask CompressAsync( Stream inputStream, Stream outputStream, - CancellationToken cancellationToken = default) => - inputStream.ToSnappyAsync(outputStream, cancellationToken); + CancellationToken cancellationToken = default + ) => inputStream.ToSnappyAsync(outputStream, cancellationToken); public ValueTask DecompressAsync( Stream inputStream, Stream outputStream, - CancellationToken cancellationToken = default) => - inputStream.UnSnappyAsync(outputStream, cancellationToken); + CancellationToken cancellationToken = default + ) => inputStream.UnSnappyAsync(outputStream, cancellationToken); - public byte[] Compress(byte[] rawBytes) => - rawBytes.ToSnappy(); + public byte[] Compress(byte[] rawBytes) => rawBytes.ToSnappy(); - public byte[] Decompress(byte[] compressedBytes) => - compressedBytes.UnSnappy(); + public byte[] Decompress(byte[] compressedBytes) => compressedBytes.UnSnappy(); - public MemoryStream Compress(Stream rawStream) => - rawStream.ToSnappy(); + public MemoryStream Compress(Stream rawStream) => rawStream.ToSnappy(); - public MemoryStream Decompress(Stream compressedStream) => - compressedStream.UnSnappy(); + public MemoryStream Decompress(Stream compressedStream) => compressedStream.UnSnappy(); - public void Compress( - Stream inputStream, - Stream outputStream) => + public void Compress(Stream inputStream, Stream outputStream) => inputStream.ToSnappy(outputStream); - public void Decompress( - Stream inputStream, - Stream outputStream) => + public void Decompress(Stream inputStream, Stream outputStream) => inputStream.UnSnappy(outputStream); -} \ No newline at end of file +} diff --git a/src/Zaabee.XZ/GlobalUsings.cs b/src/Zaabee.XZ/GlobalUsings.cs index 3de104a..b4e5168 100644 --- a/src/Zaabee.XZ/GlobalUsings.cs +++ b/src/Zaabee.XZ/GlobalUsings.cs @@ -3,4 +3,4 @@ global using System.Text; global using XZ.NET; global using Zaabee.Compressor.Abstractions; -global using Zaabee.Extensions; \ No newline at end of file +global using Zaabee.Extensions; diff --git a/src/Zaabee.XZ/XZ.Extensions.Bytes.cs b/src/Zaabee.XZ/XZ.Extensions.Bytes.cs index 3ea1c93..260247f 100644 --- a/src/Zaabee.XZ/XZ.Extensions.Bytes.cs +++ b/src/Zaabee.XZ/XZ.Extensions.Bytes.cs @@ -2,11 +2,7 @@ public static partial class XzExtensions { - public static byte[] ToXz( - this byte[] rawBytes) => - XzHelper.Compress(rawBytes); + public static byte[] ToXz(this byte[] rawBytes) => XzHelper.Compress(rawBytes); - public static byte[] UnXz( - this byte[] compressedBytes) => - XzHelper.Decompress(compressedBytes); -} \ No newline at end of file + public static byte[] UnXz(this byte[] compressedBytes) => XzHelper.Decompress(compressedBytes); +} diff --git a/src/Zaabee.XZ/XZ.Extensions.Stream.Async.cs b/src/Zaabee.XZ/XZ.Extensions.Stream.Async.cs index 089c88f..866fab5 100644 --- a/src/Zaabee.XZ/XZ.Extensions.Stream.Async.cs +++ b/src/Zaabee.XZ/XZ.Extensions.Stream.Async.cs @@ -7,24 +7,24 @@ public static ValueTask ToXzAsync( Stream outputStream, int threads = XzHelper.Threads, uint preset = XzHelper.Preset, - CancellationToken cancellationToken = default) => - XzHelper.CompressAsync(rawStream, outputStream, threads, preset, cancellationToken); + CancellationToken cancellationToken = default + ) => XzHelper.CompressAsync(rawStream, outputStream, threads, preset, cancellationToken); public static ValueTask UnXzAsync( this Stream compressedStream, Stream outputStream, - CancellationToken cancellationToken = default) => - XzHelper.DecompressAsync(compressedStream, outputStream, cancellationToken); + CancellationToken cancellationToken = default + ) => XzHelper.DecompressAsync(compressedStream, outputStream, cancellationToken); public static ValueTask ToXzAsync( this Stream rawStream, int threads = XzHelper.Threads, uint preset = XzHelper.Preset, - CancellationToken cancellationToken = default) => - XzHelper.CompressAsync(rawStream, threads, preset, cancellationToken); + CancellationToken cancellationToken = default + ) => XzHelper.CompressAsync(rawStream, threads, preset, cancellationToken); public static ValueTask UnXzAsync( this Stream compressedStream, - CancellationToken cancellationToken = default) => - XzHelper.DecompressAsync(compressedStream, cancellationToken); -} \ No newline at end of file + CancellationToken cancellationToken = default + ) => XzHelper.DecompressAsync(compressedStream, cancellationToken); +} diff --git a/src/Zaabee.XZ/XZ.Extensions.Stream.cs b/src/Zaabee.XZ/XZ.Extensions.Stream.cs index 1baf7ec..29fc063 100644 --- a/src/Zaabee.XZ/XZ.Extensions.Stream.cs +++ b/src/Zaabee.XZ/XZ.Extensions.Stream.cs @@ -6,21 +6,18 @@ public static void ToXz( this Stream rawStream, Stream outputStream, int threads = XzHelper.Threads, - uint preset = XzHelper.Preset) => - XzHelper.Compress(rawStream, outputStream, threads, preset); + uint preset = XzHelper.Preset + ) => XzHelper.Compress(rawStream, outputStream, threads, preset); - public static void UnXz( - this Stream compressedStream, - Stream outputStream) => + public static void UnXz(this Stream compressedStream, Stream outputStream) => XzHelper.Decompress(compressedStream, outputStream); public static MemoryStream ToXz( this Stream rawStream, int threads = XzHelper.Threads, - uint preset = XzHelper.Preset) => - XzHelper.Compress(rawStream); + uint preset = XzHelper.Preset + ) => XzHelper.Compress(rawStream); - public static MemoryStream UnXz( - this Stream compressedStream) => + public static MemoryStream UnXz(this Stream compressedStream) => XzHelper.Decompress(compressedStream); -} \ No newline at end of file +} diff --git a/src/Zaabee.XZ/XZ.Extensions.String.cs b/src/Zaabee.XZ/XZ.Extensions.String.cs index 368bff5..5d2b13b 100644 --- a/src/Zaabee.XZ/XZ.Extensions.String.cs +++ b/src/Zaabee.XZ/XZ.Extensions.String.cs @@ -2,13 +2,9 @@ public static partial class XzExtensions { - public static byte[] ToXz( - this string str, - Encoding? encoding = null) => + public static byte[] ToXz(this string str, Encoding? encoding = null) => XzHelper.Compress(str, encoding); - public static string UnXzToString( - this byte[] compressedBytes, - Encoding? encoding = null) => + public static string UnXzToString(this byte[] compressedBytes, Encoding? encoding = null) => XzHelper.DecompressToString(compressedBytes, encoding); -} \ No newline at end of file +} diff --git a/src/Zaabee.XZ/XZ.Helper.Bytes.cs b/src/Zaabee.XZ/XZ.Helper.Bytes.cs index 5419302..adce44a 100644 --- a/src/Zaabee.XZ/XZ.Helper.Bytes.cs +++ b/src/Zaabee.XZ/XZ.Helper.Bytes.cs @@ -2,19 +2,17 @@ public static partial class XzHelper { - public static byte[] Compress( - byte[] rawBytes) + public static byte[] Compress(byte[] rawBytes) { var outputStream = new MemoryStream(); Compress(new MemoryStream(rawBytes), outputStream); return outputStream.ToArray(); } - public static byte[] Decompress( - byte[] compressedBytes) + public static byte[] Decompress(byte[] compressedBytes) { var outputStream = new MemoryStream(); Decompress(new MemoryStream(compressedBytes), outputStream); return outputStream.ToArray(); } -} \ No newline at end of file +} diff --git a/src/Zaabee.XZ/XZ.Helper.Stream.Async.cs b/src/Zaabee.XZ/XZ.Helper.Stream.Async.cs index 5c649b9..d2f1fa1 100644 --- a/src/Zaabee.XZ/XZ.Helper.Stream.Async.cs +++ b/src/Zaabee.XZ/XZ.Helper.Stream.Async.cs @@ -6,7 +6,8 @@ public static async ValueTask CompressAsync( Stream inputStream, int threads = Threads, uint preset = Preset, - CancellationToken cancellationToken = default) + CancellationToken cancellationToken = default + ) { var outputStream = new MemoryStream(); await CompressAsync(inputStream, outputStream, threads, preset, cancellationToken); @@ -15,7 +16,8 @@ public static async ValueTask CompressAsync( public static async ValueTask DecompressAsync( Stream inputStream, - CancellationToken cancellationToken = default) + CancellationToken cancellationToken = default + ) { var outputStream = new MemoryStream(); await DecompressAsync(inputStream, outputStream, cancellationToken); @@ -27,7 +29,8 @@ public static async ValueTask CompressAsync( Stream outputStream, int threads = Threads, uint preset = Preset, - CancellationToken cancellationToken = default) + CancellationToken cancellationToken = default + ) { #if NETSTANDARD2_0 using (var xzOutputStream = new XZOutputStream(outputStream, threads, preset, true)) @@ -43,7 +46,8 @@ public static async ValueTask CompressAsync( public static async ValueTask DecompressAsync( Stream inputStream, Stream outputStream, - CancellationToken cancellationToken = default) + CancellationToken cancellationToken = default + ) { #if NETSTANDARD2_0 using (var xzInputStream = new XZInputStream(inputStream, true)) @@ -55,4 +59,4 @@ public static async ValueTask DecompressAsync( inputStream.TrySeek(0, SeekOrigin.Begin); outputStream.TrySeek(0, SeekOrigin.Begin); } -} \ No newline at end of file +} diff --git a/src/Zaabee.XZ/XZ.Helper.Stream.cs b/src/Zaabee.XZ/XZ.Helper.Stream.cs index 5649f41..8c9ec3d 100644 --- a/src/Zaabee.XZ/XZ.Helper.Stream.cs +++ b/src/Zaabee.XZ/XZ.Helper.Stream.cs @@ -5,15 +5,15 @@ public static partial class XzHelper public static MemoryStream Compress( Stream inputStream, int threads = Threads, - uint preset = Preset) + uint preset = Preset + ) { var outputStream = new MemoryStream(); Compress(inputStream, outputStream, threads, preset); return outputStream; } - public static MemoryStream Decompress( - Stream inputStream) + public static MemoryStream Decompress(Stream inputStream) { var outputStream = new MemoryStream(); Decompress(inputStream, outputStream); @@ -24,7 +24,8 @@ public static void Compress( Stream inputStream, Stream outputStream, int threads = Threads, - uint preset = Preset) + uint preset = Preset + ) { using (var xzOutputStream = new XZOutputStream(outputStream, threads, preset, true)) inputStream.CopyTo(xzOutputStream); @@ -32,13 +33,11 @@ public static void Compress( outputStream.TrySeek(0, SeekOrigin.Begin); } - public static void Decompress( - Stream inputStream, - Stream outputStream) + public static void Decompress(Stream inputStream, Stream outputStream) { using (var xzInputStream = new XZInputStream(inputStream, true)) xzInputStream.CopyTo(outputStream); inputStream.TrySeek(0, SeekOrigin.Begin); outputStream.TrySeek(0, SeekOrigin.Begin); } -} \ No newline at end of file +} diff --git a/src/Zaabee.XZ/XZ.Helper.String.cs b/src/Zaabee.XZ/XZ.Helper.String.cs index a5e8ba1..53d16ed 100644 --- a/src/Zaabee.XZ/XZ.Helper.String.cs +++ b/src/Zaabee.XZ/XZ.Helper.String.cs @@ -2,13 +2,9 @@ public static partial class XzHelper { - public static byte[] Compress( - string str, - Encoding? encoding = null) => + public static byte[] Compress(string str, Encoding? encoding = null) => Compress(str.GetBytes(encoding ?? Consts.DefaultEncoding)); - public static string DecompressToString( - byte[] compressedBytes, - Encoding? encoding = null) => + public static string DecompressToString(byte[] compressedBytes, Encoding? encoding = null) => Decompress(compressedBytes).GetString(encoding ?? Consts.DefaultEncoding); -} \ No newline at end of file +} diff --git a/src/Zaabee.XZ/XZ.Helper.cs b/src/Zaabee.XZ/XZ.Helper.cs index bc1a61d..7bc1e7f 100644 --- a/src/Zaabee.XZ/XZ.Helper.cs +++ b/src/Zaabee.XZ/XZ.Helper.cs @@ -4,4 +4,4 @@ public static partial class XzHelper { internal const int Threads = 1; internal const uint Preset = 6U; -} \ No newline at end of file +} diff --git a/src/Zaabee.XZ/XzCompressor.cs b/src/Zaabee.XZ/XzCompressor.cs index ab7932d..cc2e243 100644 --- a/src/Zaabee.XZ/XzCompressor.cs +++ b/src/Zaabee.XZ/XzCompressor.cs @@ -5,9 +5,7 @@ public sealed class XzCompressor : ICompressor private readonly int _threads; private readonly uint _preset; - public XzCompressor( - int threads = XzHelper.Threads, - uint preset = XzHelper.Preset) + public XzCompressor(int threads = XzHelper.Threads, uint preset = XzHelper.Preset) { _threads = threads; _preset = preset; @@ -15,45 +13,37 @@ public XzCompressor( public ValueTask CompressAsync( Stream rawStream, - CancellationToken cancellationToken = default) => - rawStream.ToXzAsync(_threads, _preset, cancellationToken); + CancellationToken cancellationToken = default + ) => rawStream.ToXzAsync(_threads, _preset, cancellationToken); public ValueTask DecompressAsync( Stream compressedStream, - CancellationToken cancellationToken = default) => - compressedStream.UnXzAsync(cancellationToken); + CancellationToken cancellationToken = default + ) => compressedStream.UnXzAsync(cancellationToken); public ValueTask CompressAsync( Stream inputStream, Stream outputStream, - CancellationToken cancellationToken = default) => - inputStream.ToXzAsync(outputStream, _threads, _preset, cancellationToken); + CancellationToken cancellationToken = default + ) => inputStream.ToXzAsync(outputStream, _threads, _preset, cancellationToken); public ValueTask DecompressAsync( Stream inputStream, Stream outputStream, - CancellationToken cancellationToken = default) => - inputStream.UnXzAsync(outputStream, cancellationToken); + CancellationToken cancellationToken = default + ) => inputStream.UnXzAsync(outputStream, cancellationToken); - public byte[] Compress(byte[] rawBytes) => - rawBytes.ToXz(); + public byte[] Compress(byte[] rawBytes) => rawBytes.ToXz(); - public byte[] Decompress(byte[] compressedBytes) => - compressedBytes.UnXz(); + public byte[] Decompress(byte[] compressedBytes) => compressedBytes.UnXz(); - public MemoryStream Compress(Stream rawStream) => - rawStream.ToXz(_threads, _preset); + public MemoryStream Compress(Stream rawStream) => rawStream.ToXz(_threads, _preset); - public MemoryStream Decompress(Stream compressedStream) => - compressedStream.UnXz(); + public MemoryStream Decompress(Stream compressedStream) => compressedStream.UnXz(); - public void Compress( - Stream inputStream, - Stream outputStream) => + public void Compress(Stream inputStream, Stream outputStream) => inputStream.ToXz(outputStream, _threads, _preset); - public void Decompress( - Stream inputStream, - Stream outputStream) => + public void Decompress(Stream inputStream, Stream outputStream) => inputStream.UnXz(outputStream); -} \ No newline at end of file +} diff --git a/src/Zaabee.Zstd/GlobalUsings.cs b/src/Zaabee.Zstd/GlobalUsings.cs index 1ca9304..f6d205f 100644 --- a/src/Zaabee.Zstd/GlobalUsings.cs +++ b/src/Zaabee.Zstd/GlobalUsings.cs @@ -3,4 +3,4 @@ global using System.Text; global using Zaabee.Compressor.Abstractions; global using Zaabee.Extensions; -global using ZstdNet; \ No newline at end of file +global using ZstdNet; diff --git a/src/Zaabee.Zstd/Zstd.Extensions.Bytes.cs b/src/Zaabee.Zstd/Zstd.Extensions.Bytes.cs index dde8dab..8452ec1 100644 --- a/src/Zaabee.Zstd/Zstd.Extensions.Bytes.cs +++ b/src/Zaabee.Zstd/Zstd.Extensions.Bytes.cs @@ -2,12 +2,9 @@ public static partial class ZstdExtensions { - public static byte[] ToZstd( - this byte[] rawBytes, - int level = ZstdHelper.Level) => + public static byte[] ToZstd(this byte[] rawBytes, int level = ZstdHelper.Level) => ZstdHelper.Compress(rawBytes, level); - public static byte[] UnZstd( - this byte[] compressedBytes) => + public static byte[] UnZstd(this byte[] compressedBytes) => ZstdHelper.Decompress(compressedBytes); -} \ No newline at end of file +} diff --git a/src/Zaabee.Zstd/Zstd.Extensions.Stream.Async.cs b/src/Zaabee.Zstd/Zstd.Extensions.Stream.Async.cs index 7806926..88d7d81 100644 --- a/src/Zaabee.Zstd/Zstd.Extensions.Stream.Async.cs +++ b/src/Zaabee.Zstd/Zstd.Extensions.Stream.Async.cs @@ -6,23 +6,23 @@ public static ValueTask ToZstdAsync( this Stream rawStream, Stream outputStream, int level = ZstdHelper.Level, - CancellationToken cancellationToken = default) => - ZstdHelper.CompressAsync(rawStream, outputStream, level, cancellationToken); + CancellationToken cancellationToken = default + ) => ZstdHelper.CompressAsync(rawStream, outputStream, level, cancellationToken); public static ValueTask UnZstdAsync( this Stream compressedStream, Stream outputStream, - CancellationToken cancellationToken = default) => - ZstdHelper.DecompressAsync(compressedStream, outputStream, cancellationToken); + CancellationToken cancellationToken = default + ) => ZstdHelper.DecompressAsync(compressedStream, outputStream, cancellationToken); public static ValueTask ToZstdAsync( this Stream rawStream, int level = ZstdHelper.Level, - CancellationToken cancellationToken = default) => - ZstdHelper.CompressAsync(rawStream, level, cancellationToken); + CancellationToken cancellationToken = default + ) => ZstdHelper.CompressAsync(rawStream, level, cancellationToken); public static ValueTask UnZstdAsync( this Stream compressedStream, - CancellationToken cancellationToken = default) => - ZstdHelper.DecompressAsync(compressedStream, cancellationToken); -} \ No newline at end of file + CancellationToken cancellationToken = default + ) => ZstdHelper.DecompressAsync(compressedStream, cancellationToken); +} diff --git a/src/Zaabee.Zstd/Zstd.Extensions.Stream.cs b/src/Zaabee.Zstd/Zstd.Extensions.Stream.cs index 44a182b..f80eb93 100644 --- a/src/Zaabee.Zstd/Zstd.Extensions.Stream.cs +++ b/src/Zaabee.Zstd/Zstd.Extensions.Stream.cs @@ -5,20 +5,15 @@ public static partial class ZstdExtensions public static void ToZstd( this Stream rawStream, Stream outputStream, - int level = ZstdHelper.Level) => - ZstdHelper.Compress(rawStream, outputStream, level); + int level = ZstdHelper.Level + ) => ZstdHelper.Compress(rawStream, outputStream, level); - public static void UnZstd( - this Stream compressedStream, - Stream outputStream) => + public static void UnZstd(this Stream compressedStream, Stream outputStream) => ZstdHelper.Decompress(compressedStream, outputStream); - public static MemoryStream ToZstd( - this Stream rawStream, - int level = ZstdHelper.Level) => + public static MemoryStream ToZstd(this Stream rawStream, int level = ZstdHelper.Level) => ZstdHelper.Compress(rawStream, level); - public static MemoryStream UnZstd( - this Stream compressedStream) => + public static MemoryStream UnZstd(this Stream compressedStream) => ZstdHelper.Decompress(compressedStream); -} \ No newline at end of file +} diff --git a/src/Zaabee.Zstd/Zstd.Extensions.String.cs b/src/Zaabee.Zstd/Zstd.Extensions.String.cs index ed5960f..ef2b08b 100644 --- a/src/Zaabee.Zstd/Zstd.Extensions.String.cs +++ b/src/Zaabee.Zstd/Zstd.Extensions.String.cs @@ -2,13 +2,9 @@ public static partial class ZstdExtensions { - public static byte[] ToZstd( - this string str, - Encoding? encoding = null) => + public static byte[] ToZstd(this string str, Encoding? encoding = null) => ZstdHelper.Compress(str, encoding); - public static string UnZstdToString( - this byte[] compressedBytes, - Encoding? encoding = null) => + public static string UnZstdToString(this byte[] compressedBytes, Encoding? encoding = null) => ZstdHelper.DecompressToString(compressedBytes, encoding); -} \ No newline at end of file +} diff --git a/src/Zaabee.Zstd/Zstd.Helper.Bytes.cs b/src/Zaabee.Zstd/Zstd.Helper.Bytes.cs index 28e8716..82c099e 100644 --- a/src/Zaabee.Zstd/Zstd.Helper.Bytes.cs +++ b/src/Zaabee.Zstd/Zstd.Helper.Bytes.cs @@ -2,19 +2,16 @@ public static partial class ZstdHelper { - public static byte[] Compress( - byte[] rawBytes, - int level = Level) + public static byte[] Compress(byte[] rawBytes, int level = Level) { using var options = new CompressionOptions(level); using var compressor = new ZstdNet.Compressor(options); return compressor.Wrap(rawBytes); } - public static byte[] Decompress( - byte[] compressedBytes) + public static byte[] Decompress(byte[] compressedBytes) { using var decompressor = new Decompressor(); return decompressor.Unwrap(compressedBytes); } -} \ No newline at end of file +} diff --git a/src/Zaabee.Zstd/Zstd.Helper.Stream.Async.cs b/src/Zaabee.Zstd/Zstd.Helper.Stream.Async.cs index df31d98..50b663d 100644 --- a/src/Zaabee.Zstd/Zstd.Helper.Stream.Async.cs +++ b/src/Zaabee.Zstd/Zstd.Helper.Stream.Async.cs @@ -5,7 +5,8 @@ public static partial class ZstdHelper public static async ValueTask CompressAsync( Stream inputStream, int level = Level, - CancellationToken cancellationToken = default) + CancellationToken cancellationToken = default + ) { var outputStream = new MemoryStream(); await CompressAsync(inputStream, outputStream, level, cancellationToken); @@ -14,7 +15,8 @@ public static async ValueTask CompressAsync( public static async ValueTask DecompressAsync( Stream inputStream, - CancellationToken cancellationToken = default) + CancellationToken cancellationToken = default + ) { var outputStream = new MemoryStream(); await DecompressAsync(inputStream, outputStream, cancellationToken); @@ -25,7 +27,8 @@ public static async ValueTask CompressAsync( Stream inputStream, Stream outputStream, int level = Level, - CancellationToken cancellationToken = default) + CancellationToken cancellationToken = default + ) { var inputBytes = await inputStream.ReadToEndAsync(cancellationToken: cancellationToken); var outputBytes = Compress(inputBytes, level); @@ -41,7 +44,8 @@ public static async ValueTask CompressAsync( public static async ValueTask DecompressAsync( Stream inputStream, Stream outputStream, - CancellationToken cancellationToken = default) + CancellationToken cancellationToken = default + ) { var inputBytes = await inputStream.ReadToEndAsync(cancellationToken: cancellationToken); var outputBytes = Decompress(inputBytes); @@ -53,4 +57,4 @@ public static async ValueTask DecompressAsync( inputStream.TrySeek(0, SeekOrigin.Begin); outputStream.TrySeek(0, SeekOrigin.Begin); } -} \ No newline at end of file +} diff --git a/src/Zaabee.Zstd/Zstd.Helper.Stream.cs b/src/Zaabee.Zstd/Zstd.Helper.Stream.cs index ed10099..e706e72 100644 --- a/src/Zaabee.Zstd/Zstd.Helper.Stream.cs +++ b/src/Zaabee.Zstd/Zstd.Helper.Stream.cs @@ -2,27 +2,21 @@ public static partial class ZstdHelper { - public static MemoryStream Compress( - Stream inputStream, - int level = Level) + public static MemoryStream Compress(Stream inputStream, int level = Level) { var outputStream = new MemoryStream(); Compress(inputStream, outputStream, level); return outputStream; } - public static MemoryStream Decompress( - Stream inputStream) + public static MemoryStream Decompress(Stream inputStream) { var outputStream = new MemoryStream(); Decompress(inputStream, outputStream); return outputStream; } - public static void Compress( - Stream inputStream, - Stream outputStream, - int level = Level) + public static void Compress(Stream inputStream, Stream outputStream, int level = Level) { var inputBytes = inputStream.ReadToEnd(); var outputBytes = Compress(inputBytes, level); @@ -35,9 +29,7 @@ public static void Compress( outputStream.TrySeek(0, SeekOrigin.Begin); } - public static void Decompress( - Stream inputStream, - Stream outputStream) + public static void Decompress(Stream inputStream, Stream outputStream) { var inputBytes = inputStream.ReadToEnd(); var outputBytes = Decompress(inputBytes); @@ -49,4 +41,4 @@ public static void Decompress( inputStream.TrySeek(0, SeekOrigin.Begin); outputStream.TrySeek(0, SeekOrigin.Begin); } -} \ No newline at end of file +} diff --git a/src/Zaabee.Zstd/Zstd.Helper.String.cs b/src/Zaabee.Zstd/Zstd.Helper.String.cs index 9136f57..6d6b732 100644 --- a/src/Zaabee.Zstd/Zstd.Helper.String.cs +++ b/src/Zaabee.Zstd/Zstd.Helper.String.cs @@ -2,13 +2,9 @@ public static partial class ZstdHelper { - public static byte[] Compress( - string str, - Encoding? encoding = null) => + public static byte[] Compress(string str, Encoding? encoding = null) => Compress(str.GetBytes(encoding ?? Consts.DefaultEncoding)); - public static string DecompressToString( - byte[] compressedBytes, - Encoding? encoding = null) => + public static string DecompressToString(byte[] compressedBytes, Encoding? encoding = null) => Decompress(compressedBytes).GetString(encoding ?? Consts.DefaultEncoding); -} \ No newline at end of file +} diff --git a/src/Zaabee.Zstd/Zstd.Helper.cs b/src/Zaabee.Zstd/Zstd.Helper.cs index ea7fa51..c98d4fe 100644 --- a/src/Zaabee.Zstd/Zstd.Helper.cs +++ b/src/Zaabee.Zstd/Zstd.Helper.cs @@ -3,4 +3,4 @@ public static partial class ZstdHelper { internal const int Level = 3; -} \ No newline at end of file +} diff --git a/src/Zaabee.Zstd/ZstdCompressor.cs b/src/Zaabee.Zstd/ZstdCompressor.cs index c2c50db..1a4f6b0 100644 --- a/src/Zaabee.Zstd/ZstdCompressor.cs +++ b/src/Zaabee.Zstd/ZstdCompressor.cs @@ -11,45 +11,37 @@ public ZstdCompressor(int level = ZstdHelper.Level) public ValueTask CompressAsync( Stream rawStream, - CancellationToken cancellationToken = default) => - rawStream.ToZstdAsync(_level, cancellationToken); + CancellationToken cancellationToken = default + ) => rawStream.ToZstdAsync(_level, cancellationToken); public ValueTask DecompressAsync( Stream compressedStream, - CancellationToken cancellationToken = default) => - compressedStream.UnZstdAsync(cancellationToken); + CancellationToken cancellationToken = default + ) => compressedStream.UnZstdAsync(cancellationToken); public ValueTask CompressAsync( Stream inputStream, Stream outputStream, - CancellationToken cancellationToken = default) => - inputStream.ToZstdAsync(outputStream, _level, cancellationToken); + CancellationToken cancellationToken = default + ) => inputStream.ToZstdAsync(outputStream, _level, cancellationToken); public ValueTask DecompressAsync( Stream inputStream, Stream outputStream, - CancellationToken cancellationToken = default) => - inputStream.UnZstdAsync(outputStream, cancellationToken); + CancellationToken cancellationToken = default + ) => inputStream.UnZstdAsync(outputStream, cancellationToken); - public byte[] Compress(byte[] rawBytes) => - rawBytes.ToZstd(_level); + public byte[] Compress(byte[] rawBytes) => rawBytes.ToZstd(_level); - public byte[] Decompress(byte[] compressedBytes) => - compressedBytes.UnZstd(); + public byte[] Decompress(byte[] compressedBytes) => compressedBytes.UnZstd(); - public MemoryStream Compress(Stream rawStream) => - rawStream.ToZstd(_level); + public MemoryStream Compress(Stream rawStream) => rawStream.ToZstd(_level); - public MemoryStream Decompress(Stream compressedStream) => - compressedStream.UnZstd(); + public MemoryStream Decompress(Stream compressedStream) => compressedStream.UnZstd(); - public void Compress( - Stream inputStream, - Stream outputStream) => + public void Compress(Stream inputStream, Stream outputStream) => inputStream.ToZstd(outputStream, _level); - public void Decompress( - Stream inputStream, - Stream outputStream) => + public void Decompress(Stream inputStream, Stream outputStream) => inputStream.UnZstd(outputStream); -} \ No newline at end of file +} diff --git a/tests/TestModel/Consts.cs b/tests/TestModel/Consts.cs index 3ab2371..e21aad2 100644 --- a/tests/TestModel/Consts.cs +++ b/tests/TestModel/Consts.cs @@ -4,4 +4,4 @@ public static class TestConsts { public static byte[] Data { get; } = new byte[1024 * 10]; public static string Str { get; } = "Zaabee"; -} \ No newline at end of file +} diff --git a/tests/Zaabee.BrotliNET.UnitTest/BrotliTest.cs b/tests/Zaabee.BrotliNET.UnitTest/BrotliTest.cs index f31b51f..828dc14 100644 --- a/tests/Zaabee.BrotliNET.UnitTest/BrotliTest.cs +++ b/tests/Zaabee.BrotliNET.UnitTest/BrotliTest.cs @@ -17,7 +17,7 @@ public void BrotliCompressToBytesAndDecompressToStreamTest() var decompressStream = compressedStream.UnBrotli(); Assert.Equal(0, compressedStream.Position); - + var result = decompressStream.ToArray(); Assert.Equal(TestConsts.Data, result); @@ -77,4 +77,4 @@ public void BrotliCompressStringToBytesAndDecompressToStringTestAsync() var result = compressBytes.UnBrotliToString(); Assert.Equal(TestConsts.Str, result); } -} \ No newline at end of file +} diff --git a/tests/Zaabee.BrotliNET.UnitTest/GlobalUsings.cs b/tests/Zaabee.BrotliNET.UnitTest/GlobalUsings.cs index 2e7e562..0f8d707 100644 --- a/tests/Zaabee.BrotliNET.UnitTest/GlobalUsings.cs +++ b/tests/Zaabee.BrotliNET.UnitTest/GlobalUsings.cs @@ -3,4 +3,4 @@ global using TestModel; global using Xunit; global using Zaabee.Brotli; -global using Zaabee.Extensions; \ No newline at end of file +global using Zaabee.Extensions; diff --git a/tests/Zaabee.Compressor.UnitTest/CompressAndDecompressString.Test.cs b/tests/Zaabee.Compressor.UnitTest/CompressAndDecompressString.Test.cs index 6f97319..4caa87a 100644 --- a/tests/Zaabee.Compressor.UnitTest/CompressAndDecompressString.Test.cs +++ b/tests/Zaabee.Compressor.UnitTest/CompressAndDecompressString.Test.cs @@ -31,8 +31,7 @@ public void ZstdCompressAndDecompressString() => CompressAndDecompressString(new ZstdCompressor()); [Fact] - public void XzCompressAndDecompressString() => - CompressAndDecompressString(new XzCompressor()); + public void XzCompressAndDecompressString() => CompressAndDecompressString(new XzCompressor()); [Fact] public void SnappyCompressAndDecompressString() => @@ -46,4 +45,4 @@ private void CompressAndDecompressString(ICompressor compressor) Assert.Equal(str, decompressedString); } -} \ No newline at end of file +} diff --git a/tests/Zaabee.Compressor.UnitTest/CompressToBytesAndDecompressToBytes.Test.cs b/tests/Zaabee.Compressor.UnitTest/CompressToBytesAndDecompressToBytes.Test.cs index ad0541a..960483c 100644 --- a/tests/Zaabee.Compressor.UnitTest/CompressToBytesAndDecompressToBytes.Test.cs +++ b/tests/Zaabee.Compressor.UnitTest/CompressToBytesAndDecompressToBytes.Test.cs @@ -45,4 +45,4 @@ private void CompressToBytesAndDecompressToBytesTest(ICompressor compressor) Assert.Equal(TestConsts.Data, decompressedBytes); } -} \ No newline at end of file +} diff --git a/tests/Zaabee.Compressor.UnitTest/CompressToBytesAndDecompressToStream.Test.cs b/tests/Zaabee.Compressor.UnitTest/CompressToBytesAndDecompressToStream.Test.cs index 4c26842..3466893 100644 --- a/tests/Zaabee.Compressor.UnitTest/CompressToBytesAndDecompressToStream.Test.cs +++ b/tests/Zaabee.Compressor.UnitTest/CompressToBytesAndDecompressToStream.Test.cs @@ -50,4 +50,4 @@ private void CompressToBytesAndDecompressToStreamTest(ICompressor compressor) Assert.Equal(TestConsts.Data, decompressedBytes); } -} \ No newline at end of file +} diff --git a/tests/Zaabee.Compressor.UnitTest/CompressToStreamAndDecompressToBytes.Test.cs b/tests/Zaabee.Compressor.UnitTest/CompressToStreamAndDecompressToBytes.Test.cs index a8c16d6..7e2db49 100644 --- a/tests/Zaabee.Compressor.UnitTest/CompressToStreamAndDecompressToBytes.Test.cs +++ b/tests/Zaabee.Compressor.UnitTest/CompressToStreamAndDecompressToBytes.Test.cs @@ -51,4 +51,4 @@ private void CompressToStreamAndDecompressToBytesTest(ICompressor compressor) Assert.Equal(TestConsts.Data, decompressedBytes); } -} \ No newline at end of file +} diff --git a/tests/Zaabee.Compressor.UnitTest/CompressToStreamAndDecompressToStream.Test.cs b/tests/Zaabee.Compressor.UnitTest/CompressToStreamAndDecompressToStream.Test.cs index 19bf2cd..8855405 100644 --- a/tests/Zaabee.Compressor.UnitTest/CompressToStreamAndDecompressToStream.Test.cs +++ b/tests/Zaabee.Compressor.UnitTest/CompressToStreamAndDecompressToStream.Test.cs @@ -108,4 +108,4 @@ private void CompressToStreamAndDecompressToStreamTest2(ICompressor compressor) Assert.Equal(TestConsts.Data, decompressedBytes); } -} \ No newline at end of file +} diff --git a/tests/Zaabee.Compressor.UnitTest/CompressToStreamAndDecompressToStreamAsync.Test.cs b/tests/Zaabee.Compressor.UnitTest/CompressToStreamAndDecompressToStreamAsync.Test.cs index 05f1e1c..7e3eb63 100644 --- a/tests/Zaabee.Compressor.UnitTest/CompressToStreamAndDecompressToStreamAsync.Test.cs +++ b/tests/Zaabee.Compressor.UnitTest/CompressToStreamAndDecompressToStreamAsync.Test.cs @@ -108,4 +108,4 @@ private async ValueTask CompressToStreamAndDecompressToStreamAsyncTest2(ICompres Assert.Equal(TestConsts.Data, decompressedBytes); } -} \ No newline at end of file +} diff --git a/tests/Zaabee.Compressor.UnitTest/GlobalUsings.cs b/tests/Zaabee.Compressor.UnitTest/GlobalUsings.cs index ddb0f76..2843310 100644 --- a/tests/Zaabee.Compressor.UnitTest/GlobalUsings.cs +++ b/tests/Zaabee.Compressor.UnitTest/GlobalUsings.cs @@ -10,4 +10,4 @@ global using Zaabee.SharpZipLib; global using Zaabee.Snappy; global using Zaabee.XZ; -global using Zaabee.Zstd; \ No newline at end of file +global using Zaabee.Zstd; diff --git a/tests/Zaabee.LZ4.UnitTest/GlobalUsings.cs b/tests/Zaabee.LZ4.UnitTest/GlobalUsings.cs index 472abe4..35f19a5 100644 --- a/tests/Zaabee.LZ4.UnitTest/GlobalUsings.cs +++ b/tests/Zaabee.LZ4.UnitTest/GlobalUsings.cs @@ -2,4 +2,4 @@ global using TestModel; global using Xunit; -global using Zaabee.Extensions; \ No newline at end of file +global using Zaabee.Extensions; diff --git a/tests/Zaabee.LZ4.UnitTest/Lz4Test.cs b/tests/Zaabee.LZ4.UnitTest/Lz4Test.cs index cd769ef..e9d9af6 100644 --- a/tests/Zaabee.LZ4.UnitTest/Lz4Test.cs +++ b/tests/Zaabee.LZ4.UnitTest/Lz4Test.cs @@ -78,4 +78,4 @@ public void Lz4CompressStringToBytesAndDecompressToStringTestAsync() var result = compressBytes.UnLz4ToString(); Assert.Equal(TestConsts.Str, result); } -} \ No newline at end of file +} diff --git a/tests/Zaabee.LZMA.UnitTest/GlobalUsings.cs b/tests/Zaabee.LZMA.UnitTest/GlobalUsings.cs index 472abe4..35f19a5 100644 --- a/tests/Zaabee.LZMA.UnitTest/GlobalUsings.cs +++ b/tests/Zaabee.LZMA.UnitTest/GlobalUsings.cs @@ -2,4 +2,4 @@ global using TestModel; global using Xunit; -global using Zaabee.Extensions; \ No newline at end of file +global using Zaabee.Extensions; diff --git a/tests/Zaabee.LZMA.UnitTest/LzmaTest.cs b/tests/Zaabee.LZMA.UnitTest/LzmaTest.cs index f0029c6..28ff522 100644 --- a/tests/Zaabee.LZMA.UnitTest/LzmaTest.cs +++ b/tests/Zaabee.LZMA.UnitTest/LzmaTest.cs @@ -78,4 +78,4 @@ public void LzmaCompressStringToBytesAndDecompressToStringTestAsync() var result = compressBytes.UnLzmaToString(); Assert.Equal(TestConsts.Str, result); } -} \ No newline at end of file +} diff --git a/tests/Zaabee.SharpZipLib.UnitTest/BZip2Test.cs b/tests/Zaabee.SharpZipLib.UnitTest/BZip2Test.cs index 9cef6e5..ba57484 100644 --- a/tests/Zaabee.SharpZipLib.UnitTest/BZip2Test.cs +++ b/tests/Zaabee.SharpZipLib.UnitTest/BZip2Test.cs @@ -78,4 +78,4 @@ public void BZip2CompressStringToBytesAndDecompressToStringTestAsync() var result = compressBytes.UnBZip2ToString(); Assert.Equal(TestConsts.Str, result); } -} \ No newline at end of file +} diff --git a/tests/Zaabee.SharpZipLib.UnitTest/GZipTest.cs b/tests/Zaabee.SharpZipLib.UnitTest/GZipTest.cs index 9cf577d..32a059b 100644 --- a/tests/Zaabee.SharpZipLib.UnitTest/GZipTest.cs +++ b/tests/Zaabee.SharpZipLib.UnitTest/GZipTest.cs @@ -17,7 +17,7 @@ public void GZipCompressToBytesAndDecompressToStreamTest() var decompressStream = compressedStream.UnGZip(); Assert.Equal(0, decompressStream.Position); - + var result = decompressStream.ToArray(); Assert.Equal(TestConsts.Data, result); @@ -78,4 +78,4 @@ public void GZipCompressStringToBytesAndDecompressToStringTestAsync() var result = compressBytes.UnGZipToString(); Assert.Equal(TestConsts.Str, result); } -} \ No newline at end of file +} diff --git a/tests/Zaabee.SharpZipLib.UnitTest/GlobalUsings.cs b/tests/Zaabee.SharpZipLib.UnitTest/GlobalUsings.cs index d6faea6..1ac4e0f 100644 --- a/tests/Zaabee.SharpZipLib.UnitTest/GlobalUsings.cs +++ b/tests/Zaabee.SharpZipLib.UnitTest/GlobalUsings.cs @@ -1,4 +1,4 @@ // Global using directives global using TestModel; -global using Zaabee.Extensions; \ No newline at end of file +global using Zaabee.Extensions; diff --git a/tests/Zaabee.SharpZipLib.UnitTest/Usings.cs b/tests/Zaabee.SharpZipLib.UnitTest/Usings.cs index 8c927eb..c802f44 100644 --- a/tests/Zaabee.SharpZipLib.UnitTest/Usings.cs +++ b/tests/Zaabee.SharpZipLib.UnitTest/Usings.cs @@ -1 +1 @@ -global using Xunit; \ No newline at end of file +global using Xunit; diff --git a/tests/Zaabee.Snappy.UnitTest/GlobalUsings.cs b/tests/Zaabee.Snappy.UnitTest/GlobalUsings.cs index 472abe4..35f19a5 100644 --- a/tests/Zaabee.Snappy.UnitTest/GlobalUsings.cs +++ b/tests/Zaabee.Snappy.UnitTest/GlobalUsings.cs @@ -2,4 +2,4 @@ global using TestModel; global using Xunit; -global using Zaabee.Extensions; \ No newline at end of file +global using Zaabee.Extensions; diff --git a/tests/Zaabee.Snappy.UnitTest/SnappyTest.cs b/tests/Zaabee.Snappy.UnitTest/SnappyTest.cs index 4080d93..cb78668 100644 --- a/tests/Zaabee.Snappy.UnitTest/SnappyTest.cs +++ b/tests/Zaabee.Snappy.UnitTest/SnappyTest.cs @@ -78,4 +78,4 @@ public void SnappyCompressStringToBytesAndDecompressToStringTestAsync() var result = compressBytes.UnSnappyToString(); Assert.Equal(TestConsts.Str, result); } -} \ No newline at end of file +} diff --git a/tests/Zaabee.XZ.UnitTest/GlobalUsings.cs b/tests/Zaabee.XZ.UnitTest/GlobalUsings.cs index 472abe4..35f19a5 100644 --- a/tests/Zaabee.XZ.UnitTest/GlobalUsings.cs +++ b/tests/Zaabee.XZ.UnitTest/GlobalUsings.cs @@ -2,4 +2,4 @@ global using TestModel; global using Xunit; -global using Zaabee.Extensions; \ No newline at end of file +global using Zaabee.Extensions; diff --git a/tests/Zaabee.XZ.UnitTest/XzTest.cs b/tests/Zaabee.XZ.UnitTest/XzTest.cs index b8de448..5cfdb3d 100644 --- a/tests/Zaabee.XZ.UnitTest/XzTest.cs +++ b/tests/Zaabee.XZ.UnitTest/XzTest.cs @@ -78,4 +78,4 @@ public void XzCompressStringToBytesAndDecompressToStringTestAsync() var result = compressBytes.UnXzToString(); Assert.Equal(TestConsts.Str, result); } -} \ No newline at end of file +} diff --git a/tests/Zaabee.Zstd.UnitTest/GlobalUsings.cs b/tests/Zaabee.Zstd.UnitTest/GlobalUsings.cs index 472abe4..35f19a5 100644 --- a/tests/Zaabee.Zstd.UnitTest/GlobalUsings.cs +++ b/tests/Zaabee.Zstd.UnitTest/GlobalUsings.cs @@ -2,4 +2,4 @@ global using TestModel; global using Xunit; -global using Zaabee.Extensions; \ No newline at end of file +global using Zaabee.Extensions; diff --git a/tests/Zaabee.Zstd.UnitTest/ZstdTest.cs b/tests/Zaabee.Zstd.UnitTest/ZstdTest.cs index 6029551..dc6bf26 100644 --- a/tests/Zaabee.Zstd.UnitTest/ZstdTest.cs +++ b/tests/Zaabee.Zstd.UnitTest/ZstdTest.cs @@ -78,4 +78,4 @@ public void ZstdCompressStringToBytesAndDecompressToStringTestAsync() var result = compressBytes.UnZstdToString(); Assert.Equal(TestConsts.Str, result); } -} \ No newline at end of file +}