Reputation: 341
When using zlib
, what is the minimum and maximum input buffer size that can handle deflate()
and inflate()
?
Upvotes: 1
Views: 1670
Reputation: 33658
The minimum buffer size is 0. Regarding the maximum size, see the zlib FAQ:
Can zlib work with greater than 4 GB of data?
Yes.
inflate()
anddeflate()
will process any amount of data correctly. Each call ofinflate()
ordeflate()
is limited to input and output chunks of the maximum value that can be stored in the compiler's "unsigned int" type, but there is no limit to the number of chunks. Note however that thestrm.total_in
andstrm_total_out
counters may be limited to 4 GB. These counters are provided as a convenience and are not used internally byinflate()
ordeflate()
. The application can easily set up its own counters updated after each call ofinflate()
ordeflate()
to count beyond 4 GB.
Upvotes: 2