DEFLATE 알고리즘을 통과 한 일부 데이터가 있습니다. perl -MCompress::Zlib -e 'undef $/; print uncompress(<>)' < deflated_data.gz
올바른 출력이 인쇄됩니다. 그러나 같은 데이터에서 다음 코드를 사용하면 데이터를 부풀려 시도 할 때 InvalidDataException
이 표시됩니다. INFLATE가 구현되어 데이터가 올바르지 않은 곳이 표시됩니까?DEFLATED 데이터의 유효성 확인
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();
}
}
}
[GZip을 사용하는 예외] 가능한 복제본 (http://stackoverflow.com/questions/11271282/exception-using-gzip) –
이것은 중복되지 않습니다. GZip 및 Deflate의 데이터 형식에는 차이가 있습니다. – cytinus