zlib.createDeflateRaw([options])


创建并返回新的 DeflateRaw 对象。

当原始 deflate 流的 windowBits 设置为 8 时,zlib 从 1.2.8 到 1.2.11 的升级改变了行为。 如果最初设置为 8,则 zlib 会自动将 windowBits 设置为 9。 较新版本的 zlib 会抛出异常,因此 Node.js 恢复了将值从 8 升级到 9 的原始行为,因为将 windowBits = 9 传给 zlib 实际上会产生一个仅有效使用 8 位窗口的压缩流。

Creates and returns a new DeflateRaw object.

An upgrade of zlib from 1.2.8 to 1.2.11 changed behavior when windowBits is set to 8 for raw deflate streams. zlib would automatically set windowBits to 9 if was initially set to 8. Newer versions of zlib will throw an exception, so Node.js restored the original behavior of upgrading a value of 8 to 9, since passing windowBits = 9 to zlib actually results in a compressed stream that effectively uses an 8-bit window only.