0
votes

So I've been reading a lot and I think I understand but it'd be great if someone who knows more than me could confirm. So I know that gzip -d supports the decompression of concatenated streams. Does that mean, let's say I take an input (from a stream, file, whatever) and split it in half. I compress each one up separately (with GZIPOutputStream or something). So now I have two byte arrays holding all this information (header, data, trailer). I've basically got two separate .gz files (if I wanted to store them as files). If I concatenated these two byte arrays, nothing added in between, in one giant byte array and sent that to an output stream, would gzip return the original input?

Or better yet, you have two .gz files, you grab them, concatenate them, and send them out as on .gz file. Would gzip -d give you a file containing the contents of both original files?

1

1 Answers

2
votes

Yes.

(Stackoverflow won't let me answer just "yes", so I repeat, Yes.)