DEV Community

Harish Ahuja
Harish Ahuja

Posted on

Decompress in Python

Decompress in Python

0

i have a code which can decompress my api response

 protected string Decompress(string compressedstring)
        {
            string strResult = ""
            byte[] input = Convert.FromBase64String(compressedstring);
            using (MemoryStream inputStream = new MemoryStream(input))
            {
                using (DeflateStream gzip = new DeflateStream(inputStream, CompressionMode.Decompress))
                {
                    using (StreamReader reader = new StreamReader(gzip, System.Text.Encoding.UTF8))
            {strResult = reader.ReadToEnd();}
                }
            }

Top comments (0)