public static byte[] GZipDecompress(Byte[] bytes) { BinaryReader br = null; System.IO.Compression.GZipStream dcmp = null; try { using (MemoryStream ms = new MemoryStream(bytes)) { dcmp = new System.IO.Compression.GZipStream(ms, System.IO.Compression.CompressionMode.Decompress); br = new BinaryReader(dcmp); return br.ReadBytes((int)dcmp.Length); } } catch (System.Exception e) { } finally { br.Close(); dcmp.Close(); } return bytes; }
转载于:https://www.cnblogs.com/appleii/archive/2012/04/20/2460126.html