public static byte[] Decompress(byte[] input) { // two bytes shaved off (zlib header) var sourceStream = new MemoryStream(input, 2, input.Length - 2); var stream = new DeflateStream(sourceStream, CompressionMode.Decompress); return stream.ReadAllBytes(); }