zlib for zEnterprise Data Compression
The zlib data compression library provides in-memory compression and decompression functions, including integrity checks of the uncompressed data. A modified version of the zlib compression library is used by zEDC. The IBM-provided zlib compatible C library provides a set of wrapper functions that use zEDC compression when appropriate and when zEDC is not appropriate, software-based compression services are used.
The zlib wrapper functions use the following criteria to determine
if zEDC can be used for compression:
- The system requirements for zEDC have been met. See Requirements for zEnterprise Data Compression for the details.
- For a deflate stream, the parameters specified on deflateInit2() are supported by zEDC. For an inflate stream, all the parameters specified on inflateInit2() are supported. See Standard zlib functions for the details.
- Because there are overhead costs when communicating with the hardware, on the first call to deflate or inflate a data stream, the provided input is checked to ensure that it is sufficiently large enough to make it worthwhile to use zEDC. If the data stream is large enough, zEDC is used. If the data stream is small, it might cost more to compress the data stream with zEDC so software-based compression services are used. Note: This check is only performed on the first call to deflate or inflate a data stream.
Once zEDC is used as the compression mechanism (for example, after
the first call to inflate or deflate the data stream is completed),
you cannot change the compression method to software-based compression
services. At the same time, if software-based compression services
are used as the compression mechanism (for example, after the first
call to inflate or deflate the data stream is completed), you cannot
change the compression method to zEDC.
Note: Once a data stream starts
using zEDC for compression, if a function is called that cannot be
supported by zEDC or the zEDC hardware becomes unavailable, the unsupported
function returns an error return code.