Compress zlib
来源:百度文库 编辑:神马文学网 时间:2024/04/28 20:07:11
Ezlib.lib
Estlib.lib
#include
#include
#include
#include
{
int err;
z_stream c_stream; /* compression stream */
Byte * compr;
uLong comprLen = 20*sizeof(int);
compr = (Byte*)calloc((uInt)comprLen, 1);
const char hello[] = "hello, hello!";
uLong len = (uLong)strlen(hello)+1;
c_stream.zalloc = (alloc_func)0;
c_stream.zfree = (free_func)0;
c_stream.opaque = (voidpf)0;
err = deflateInit(&c_stream, Z_DEFAULT_COMPRESSION);
c_stream.next_in = (Bytef*)hello;
c_stream.next_out = compr;
while (c_stream.total_in != len && c_stream.total_out < comprLen)
{
c_stream.avail_in = c_stream.avail_out = 1; /* force small buffers */
err = deflate(&c_stream, Z_NO_FLUSH);
} /* Finish the stream, still forcing small buffers: */
deflateEnd(&c_stream);
free(compr);
}
Estlib.lib
#include
#include
#include
#include
{
int err;
z_stream c_stream; /* compression stream */
Byte * compr;
uLong comprLen = 20*sizeof(int);
compr = (Byte*)calloc((uInt)comprLen, 1);
const char hello[] = "hello, hello!";
uLong len = (uLong)strlen(hello)+1;
c_stream.zalloc = (alloc_func)0;
c_stream.zfree = (free_func)0;
c_stream.opaque = (voidpf)0;
err = deflateInit(&c_stream, Z_DEFAULT_COMPRESSION);
c_stream.next_in = (Bytef*)hello;
c_stream.next_out = compr;
while (c_stream.total_in != len && c_stream.total_out < comprLen)
{
c_stream.avail_in = c_stream.avail_out = 1; /* force small buffers */
err = deflate(&c_stream, Z_NO_FLUSH);
} /* Finish the stream, still forcing small buffers: */
deflateEnd(&c_stream);
free(compr);
}
Compress zlib
zlib Home Site
zlib用法简单说明
Zlib库的版本及下载地址
Re: 请问有谁用过zlib库的?
使用zlib对swf压缩文件进行解压缩
使用zlib对swf压缩文件进行解压缩
压缩解压缩的函数库zlib的使用--gqlyxg1981的博客
编译器从业者 (Beta): 使用zlib库压缩数据
使用zlib对swf压缩文件进行解压缩--学习纪事
Zlib库的版本及下载地址--学习纪事
压缩解压缩的函数库zlib的使用--gqlyxg1981的博客
J2ME下的Zlib/Gzip/Zip压缩相关
PHP的GZIP压缩页面例子,使用zlib扩展实现页面GZIP压缩输出
PHP使用zlib扩展实现页面GZIP压缩输出 - 『PHP/Perl编程专区』 - 台州站长论坛 |台州论坛|站长论坛|TVB电视剧|PHP论坛|MYSQL论坛|Ajax论坛|DIV CSS论坛|J