Given a gzip file Z, if I decompress it to Z', is there any way I can recompress it to get the exact same gzip file Z back? After a cursory reading of the DEFLATE format, I am guessing no, as any given file may have multiple representations in DEFLATE stream format, and there is no way to determine which one was originally used. Can anybody confirm whether this reasoning is correct, and if not, point out how I can do this?
For bonus points, which compression algorithms/formats are tightly specified enough that there is only ever one compressed representation of a file?
Thanks!