Itterative detection of deflate parameters



I am trying to iteratively detect what deflate parameters (level and
memLevel) were used to compress the input stream.

My general approach is to initialize deflateInit2 with various
combinations of level and memLevel (81 combinations) and then see if I
can first inflate the input (a few bytes at a time), then pass those
bytes into deflate and see if the output compressed bytes match the
input.

In order to guarantee that deflate pushed all of its compressed bytes
into the output, should I be setting the flag Z_SYNC_FLUSH to each
call of deflate so that all the compressed bytes are available for
comparison?

B

.



Relevant Pages

  • Re: zlib on Palm OS PDA and PHP web server
    ... me an error when I try to decompress/deflate the data. ... name) and getting a zlib stream instead, or b) the data is corrupted ... There is no standard for how a deflator must compress. ... compressuses deflate(). ...
    (comp.compression)
  • Re: WriteStream to ReadStream adaptor?
    ... deflate:= DeflateStream on: x readStream. ... That way you can manage how to feed it the contents to compress. ... compressed:= compressed contents readStream. ... And let's use a bag so that we don't need to build the 1M string: ...
    (comp.lang.smalltalk)
  • Re: blocking records with zlib and Z_SYNC_FLUSH
    ... deflate operation and just use compress() to recompress the block once ... And only if it doesn't fit that way would I need ... which takes at most three deflate passes. ...
    (comp.compression)
  • Re: deflate parts of a file
    ... while leaving others as ASCII on the ouput stream. ... Which deflate example are you referring to? ... string and then doing one deflate, ouput, flush and output the ... compress method has a horrible performance. ...
    (comp.lang.perl.misc)
  • Re: zlib on Palm OS PDA and PHP web server
    ... On a forum I was told that the zlib stream defined in 1950 2.2 Data ... format was produced by compress and that the 'compressed data' within ... by deflate. ...
    (comp.compression)