问题
I try to compress memory data by using libbz2 library in C program.
Should I use this function of libbz2?:
int BZ2_bzCompress ( bz_stream *strm, int action );
Can anyone show me an example?
Thank you.
回答1:
http://www.bzip.org/1.0.3/html/util-fns.html
Use BZ2_bzBuffToBuffCompress()
and BZ2_bzBuffToBuffDecompress()
for simple paired compress/decompress.
This page describes the meaning of the last 3 parms: http://www.bzip.org/1.0.3/html/low-level.html
来源:https://stackoverflow.com/questions/9577735/how-compress-data-in-memory-buffer-by-using-libbz2-library-in-c-program