gl393
gl393

Reputation: 341

What is the minimum/maximum input size for deflate() or inflate() in zlib?

When using zlib, what is the minimum and maximum input buffer size that can handle deflate() and inflate() ?

Upvotes: 1

Views: 1670

Answers (1)

nwellnhof
nwellnhof

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() and deflate() will process any amount of data correctly. Each call of inflate() or deflate() 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 the strm.total_in and strm_total_out counters may be limited to 4 GB. These counters are provided as a convenience and are not used internally by inflate() or deflate(). The application can easily set up its own counters updated after each call of inflate() or deflate() to count beyond 4 GB.

Upvotes: 2

Related Questions