I tested it myself, and I get a DllNotFoundException:
System.DllNotFoundException: MonoPosixHelper at (wrapper managed-to-native) System.IO.Compression.DeflateStream:CreateZStream (System.IO.Compression.CompressionMode,bool,System.IO.Compression.DeflateStream/UnmanagedReadOrWrite,intptr) at System.IO.Compression.DeflateStream..ctor (System.IO.Stream compressedStream, CompressionMode mode, Boolean leaveOpen, Boolean gzip) [0x00000] in <filename unknown>:0 at System.IO.Compression.DeflateStream..ctor (System.IO.Stream compressedStream, CompressionMode mode) [0x00000] in <filename unknown>:0 at (wrapper remoting-invoke-with-check) System.IO.Compression.DeflateStream:.ctor (System.IO.Stream,System.IO.Compression.CompressionMode)
It looks like it's a CreateZStream function, which is an external method that needs to be defined inside MonoPosixHelper.dll.
CreateZStream is declared as
[DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)] private static extern IntPtr CreateZStream(CompressionMode compress, bool gzip, DeflateStream.UnmanagedReadOrWrite feeder, IntPtr data);
However, the file "MonoPosixHelper.dll" does not exist. There's libMonoPosixHelper.dylib, which seems to implement an entry point for CreateZStream, however, that library for mac.
Personally, I have had poor experience with most Unity compression codes / libraries, since most implementations simply port their own code library. According to the compatibility page , the class is supported, however, it only looks like the managed part is implemented . This one also seems to confirm this.
I have successfully used the SharpZipLib library in a large number of projects. This is a clean managed library with no native code dependencies. I used this library in standalone networks, Android and iOS builds without any problems.
Bunny83
source share