Example #1
0
        public static byte[] ZibDecompress(byte[] data)
        {
            var ms = new MemoryStream(data);
            using (var msDecompressed = new System.IO.MemoryStream())
            {
                using (var zs = new ZlibStream(msDecompressed, CompressionMode.Decompress, true))
                {
                    int readByte = ms.ReadByte();
                    while (readByte != -1)
                    {
                        zs.WriteByte((byte)readByte);
                        readByte = ms.ReadByte();
                    }
                    zs.Flush();
                }
                return msDecompressed.ToArray();

            }
        }