0

I have a requirement that while doing raw deflate, zlib is provided with a prehistory buffer of 4KB to seed dictionary. The input Data CHUNK Size is also 4KB and prehistory needs to be used for each one of them, and every 4KB data from file is independently compressed. I have doubts about window size and where is Dictionary loaded in Window (at position 0) Following are some questions.

  1. Should my Window size here be 8KB [4KB for Prehistory + 4KB for history produced with Raw Data]
  2. Is it correct that while using deflateSetDictionary, the first 4KB of window will be loaded with Dictionary(pre-history) buffer and next 4KB in window will be filled as raw data is compressed

1 Answer 1

0
  1. Yes, your dictionary size should be at least 8K.
  2. You simply provide 4K of data with deflateSetDictionary(), using the length argument. zlib deals with where it actually goes in the buffer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.