I have some data that has been passed through the DEFLATE algorithm. If I run the command perl -MCompress::Zlib -e 'undef $/; print uncompress(<>)' < deflated_data.gz
The correct output is printed. However, if I use the following code on the same data, I receive a InvalidDataException
when trying to inflate the data. Is there any implementation of INFLATE that will show me where the data is not correct?
public byte[] Inflate(byte[] inputData)
{
using (Stream input = new DeflateStream(new MemoryStream(inputData),
CompressionMode.Decompress))
{
using (MemoryStream output = new MemoryStream())
{
input.CopyTo(output);
return output.ToArray();
}
}
}