|
@ -326,10 +326,16 @@ function Zlib(opts, mode) { |
|
|
self.emit('error', error); |
|
|
self.emit('error', error); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
var level = exports.Z_DEFAULT_COMPRESSION; |
|
|
|
|
|
if (typeof opts.level === 'number') level = opts.level; |
|
|
|
|
|
|
|
|
|
|
|
var strategy = exports.Z_DEFAULT_STRATEGY; |
|
|
|
|
|
if (typeof opts.strategy === 'number') strategy = opts.strategy; |
|
|
|
|
|
|
|
|
this._binding.init(opts.windowBits || exports.Z_DEFAULT_WINDOWBITS, |
|
|
this._binding.init(opts.windowBits || exports.Z_DEFAULT_WINDOWBITS, |
|
|
opts.level || exports.Z_DEFAULT_COMPRESSION, |
|
|
level, |
|
|
opts.memLevel || exports.Z_DEFAULT_MEMLEVEL, |
|
|
opts.memLevel || exports.Z_DEFAULT_MEMLEVEL, |
|
|
opts.strategy || exports.Z_DEFAULT_STRATEGY, |
|
|
strategy, |
|
|
opts.dictionary); |
|
|
opts.dictionary); |
|
|
|
|
|
|
|
|
this._buffer = new Buffer(this._chunkSize); |
|
|
this._buffer = new Buffer(this._chunkSize); |
|
|