Pregunta

I'm using udp to communicate between server and client.
The server has the ability to compress packets if they are too long (Deflate).
Now the problem is that sometimes the packet is still too long, even after compression.
After some experimenting I found out that such truncated compressed data is still decompressable (until the point of truncation of course).

Now the question is:
Can the result of the decompression change except for truncation (for Deflate)?

¿Fue útil?

Solución

If your question is: "Can the decompression of a truncated deflate stream deliver something other than the truncation of the original uncompressed data?", then the answer is no. There cannot be a misinterpretation of a truncated code to mean some other code. The Huffman codes that make up a deflate stream are prefix codes, so if the last code in the stream is cut off in the middle of the bits of that code, then that code is simply not decoded. The prefix bits unambiguously indicate that the whole code is not there.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top