but it always returns 0. When stepping into this its due GZIPDecompressorInputStream::helper->data (in helper->doNextBlock) are zero. What am I doing wrong here?
Ok, but I've no idea exactly what format that tool emits, or whether it's compatible with the zlib code that the juce class uses internally. Maybe it adds extra header bytes or something.. it certainly sounds like the format's not compatible.
then I guess the question is: What would be the right tool to compress the data?
cat test.xml | python -c 'import sys,zlib; sys.stdout.write(zlib.compress(sys.stdin.read()))' > test
does it, but what a hassle!
Doesn't seem there is any (pre-installed) command line tool capable of creating a plain zlib compressed file. Maybe a good option for the binary builder to create compressed binary data?
it seems like GZIP is the wrong name for this class as it doesnt support GZIP format
for decoding it doesnt use automatic header recognition (juce uses windowsBits of 15)
windowBits can also be greater than 15 for optional gzip decoding. Add 32 to windowBits to enable zlib and gzip decoding with automatic header detection, or add 16 to decode only the gzip format (the zlib format will return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a crc32 instead of an adler32.
so maybe line 103 of juce_GZIPDecompressorInputStream.cpp should be
Ah, that's interesting - I didn't know it supported that option (and actually, when I first added zlib support to juce many years ago, it probably didn't!)
That "dontWrap" thing always annoyed me - it's something I copied from zlib and never found a good piece of documentation explaining what it did or why it had that name.
So I guess that if it now supports auto-detection, I could safely remove the option altogether and just always pass 32..