This is a port of Microsoft's code from here.
The classes in System.IO.Compression in Unity 4.x do not seem to work on Windows and perhaps several other platforms.
Luckily, Microsoft has released much of the source code of the .NET BCL. We have ported Microsoft's code to work in Unity. This seems like the cleanest and most stable way to get the GZipStream and DeflateStream classes working in Unity.
Find the plugin on the Unity Asset Store here.