mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
chore: format via csharpier
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using System.IO.Compression;
|
||||
|
||||
|
||||
namespace SharpbinV3.Server.Services
|
||||
{
|
||||
public class CompressionService : ICompressionService
|
||||
@@ -21,16 +20,21 @@ namespace SharpbinV3.Server.Services
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
public byte[] Compress(string data)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(data);
|
||||
return Compress(System.Text.Encoding.UTF8.GetBytes(data));
|
||||
}
|
||||
|
||||
public byte[] Decompress(byte[] compressedData)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(compressedData);
|
||||
if (!IsCompressed(compressedData))
|
||||
throw new ArgumentException("Data is not in a valid compressed format.", nameof(compressedData));
|
||||
throw new ArgumentException(
|
||||
"Data is not in a valid compressed format.",
|
||||
nameof(compressedData)
|
||||
);
|
||||
|
||||
using (MemoryStream ms = new())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user