When using the Async code provided, it fails with the following exception thrown:
InvalidDataException:
The magic number in GZip header is not correct. Make sure you are passing in a GZip stream.
The exact line which throws the exception is marked with a (=>) sign below:
'
GZipStream gzip = new GZipStream(memory, CompressionMode.Decompress,false);
=> int uncompressedLength = gzip.Read(uncompressedBuffer, 0, uncompressedBuffer.Length);
output.AddRange(uncompressedBuffer.Take(uncompressedLength));
'
I'm currently investigating the problem and trying to figure out a fix, if you have a solution kindly let us know,
Thank you,
Mohammed