使用zlib时如何更改deflate流输出格式(raw,zlib,gzip)? [英] How to change deflate stream output format(raw, zlib, gzip) when use zlib?
本文介绍了使用zlib时如何更改deflate流输出格式(raw,zlib,gzip)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Zlib
can output three format, I try to search the docs and zlib.h
, but can't find a clear explanation about the options, anyone have any ideas?
推荐答案
From the zlib.h documentation of deflateInit2()
:
windowBits can also be -8..-15 for raw deflate. In this case, -windowBits
determines the window size. deflate() will then generate raw deflate data
with no zlib header or trailer, and will not compute a check value.
windowBits can also be greater than 15 for optional gzip encoding. Add
16 to windowBits to write a simple gzip header and trailer around the
compressed data instead of a zlib wrapper.
这篇关于使用zlib时如何更改deflate流输出格式(raw,zlib,gzip)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文