You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
778 B
27 lines
778 B
using System.IO;
|
|
using System.IO.Compression;
|
|
|
|
namespace UnityEditor.U2D.Aseprite
|
|
{
|
|
internal static class Zlib
|
|
{
|
|
public static byte[] Decompress(byte[] compressedData)
|
|
{
|
|
byte[] decompressedData;
|
|
using (var decompressedStream = new MemoryStream())
|
|
{
|
|
using (var compressStream = new MemoryStream(compressedData))
|
|
{
|
|
using (var deflateStream = new DeflateStream(compressStream, CompressionMode.Decompress))
|
|
{
|
|
deflateStream.CopyTo(decompressedStream);
|
|
}
|
|
}
|
|
|
|
decompressedData = decompressedStream.ToArray();
|
|
}
|
|
return decompressedData;
|
|
}
|
|
}
|
|
}
|