读书人

求压缩解压缩类库-

发布时间: 2012-06-23 14:52:43 作者: rapoo

求压缩解压缩类库--在线等
请问:哪个类库(C/C++)能够基于内存压缩、解压缩GZIP格式(包含GZIP格式头、尾)数据?

基于内存:
待压缩数据来自内存(数组等);
压缩后数据在内存中保存(不是文件)。

谢谢!

[解决办法]
我这有一个zip c++类库,作者是Lucian Wischik,貌似是支持内存数据 压缩/解压缩。

C/C++ code
HZIP OpenZip(void *z,unsigned int len, const char *password);// from a memory block:     OpenZip(bufstart, buflen,0);ZRESULT ZipAdd(HZIP hz, const TCHAR *dstzn, void *src, unsigned int len);// from memory:  ZipAdd(hz, "subdir\\file.dat", buf, len);ZRESULT ZipGetMemory(HZIP hz, void **buf, unsigned long *len);// ZipGetMemory - If the zip was created in memory, via ZipCreate(0,len),// then this function will return information about that memory block.ZRESULT UnzipItem(HZIP hz, int index, void *z,unsigned int len);// to a memory block:     UnzipItem(hz,i, buf,buflen); 

读书人网 >C++

热点推荐