На сайте zlib есть пример использования: http://www.zlib.net/zlib_how.html
Однако в этом примере они сжимают файл. Я хотел бы сжать двоичные данные, хранящиеся в буфере в памяти. Я также не хочу сохранять сжатый буфер на диск.
В основном здесь мой буфер:
fIplImageHeader->imageData = (char*)imageIn->getFrame();
Как сжать его с помощью zlib?
Я был бы признателен за пример кода, как это сделать.