compressBound

Name

compressBound -- compute compressed data size

Synopsis

#include <zlib.h>

int compressBound(uLong sourceLen);

Description

The compressBound() function shall estimate the size of buffer required to compress sourceLen bytes of data using the compress() or compress2() functions. If successful, the value returned shall be an upper bound for the size of buffer required to compress sourceLen bytes of data, using the parameters stored in stream, in a single call to compress() or compress2().

Return Value

The compressBound() shall return a value representing the upper bound of an array to allocate to hold the compressed data in a single call to compress() or compress2(). This function may return a conservative value that may be larger than sourceLen.

Errors

None defined.