GetMaxCompressedSize API - Estimate largest possible buffer size

Estimates the size of the largest possible buffer required to compress a block of data. srcLen indicates the size of a block of data about to be compressed. The library returns the theoretical maximum size of the buffer after compression as tgtLen.

Db2® will use the value returned as tgtLen to optimize its use of memory internally. The penalty for not calculating a value or for calculating an incorrect value is that Db2 will have to call the Compress API more than once for a single block of data, or that it may waste memory from the utility heap. Db2 will still create the backup correctly, regardless of the values returned.

Authorization

None

Required connection

None

API include file

sqlucompr.h

API and data structure syntax

int GetMaxCompressedSize(
      struct COMPR_CB *pCB,
      db2Uint32 srcLen);

GetMaxCompressedSize API parameters

pCB
Input. This is the control block that was returned by the InitCompression API call.
srcLen
Input. Size in bytes of a block of data about to be compressed.