()
| 148 | } |
| 149 | |
| 150 | function zlibBufferOnEnd() { |
| 151 | let buf; |
| 152 | if (this.nread === 0) { |
| 153 | buf = new FastBuffer(); |
| 154 | } else { |
| 155 | const bufs = this.buffers; |
| 156 | buf = (bufs.length === 1 ? bufs[0] : Buffer.concat(bufs, this.nread)); |
| 157 | } |
| 158 | this.close(); |
| 159 | if (this._info) |
| 160 | this.cb(null, { buffer: buf, engine: this }); |
| 161 | else |
| 162 | this.cb(null, buf); |
| 163 | } |
| 164 | |
| 165 | function zlibBufferSync(engine, buffer) { |
| 166 | if (typeof buffer === 'string') { |