For some reason I cannot find any examples for doing so with DotNetZip
.
I receive a Gziped
content from my WebAPI
.
All I want to do is to read that memory stream from the response and unzip the content(text) into a string.
My compression working fine, I just can't figure out the decompress:
public static byte[] CompressData(byte[] str)
{
using (var output = new MemoryStream())
{
using (
var compressor = new Ionic.Zlib.DeflateStream(
output, Ionic.Zlib.CompressionMode.Compress,
Ionic.Zlib.CompressionLevel.BestSpeed))
{
compressor.Write(str, 0, str.Length);
}
return output.ToArray();
}
}