Ejemplo n.º 1
0
        private async Task <string> DeflateResponse(byte[] data)
        {
            byte[] decompressedData   = new byte[data.Length * 100];
            int    decompressedLength = 0;

            using (MemoryStream memory = new MemoryStream(data))
                using (InflaterInputStream inflater = new InflaterInputStream(memory))
                    decompressedLength = await inflater.ReadAsync(decompressedData, 0, decompressedData.Length);

            return(Encoding.Default.GetString(decompressedData));
        }