暫無描述
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.

1234567891011121314151617181920212223242526
  1. using System.IO;
  2. using System.IO.Compression;
  3. namespace UnityEditor.U2D.Aseprite
  4. {
  5. internal static class Zlib
  6. {
  7. public static byte[] Decompress(byte[] compressedData)
  8. {
  9. byte[] decompressedData;
  10. using (var decompressedStream = new MemoryStream())
  11. {
  12. using (var compressStream = new MemoryStream(compressedData))
  13. {
  14. using (var deflateStream = new DeflateStream(compressStream, CompressionMode.Decompress))
  15. {
  16. deflateStream.CopyTo(decompressedStream);
  17. }
  18. }
  19. decompressedData = decompressedStream.ToArray();
  20. }
  21. return decompressedData;
  22. }
  23. }
  24. }