| 482 | } |
| 483 | |
| 484 | function processChunk(self, chunk, flushFlag, cb) { |
| 485 | const handle = self._handle; |
| 486 | if (!handle) return process.nextTick(cb); |
| 487 | |
| 488 | handle.buffer = chunk; |
| 489 | handle.cb = cb; |
| 490 | handle.availOutBefore = self._chunkSize - self._outOffset; |
| 491 | handle.availInBefore = chunk.byteLength; |
| 492 | handle.inOff = 0; |
| 493 | handle.flushFlag = flushFlag; |
| 494 | |
| 495 | handle.write(flushFlag, |
| 496 | chunk, // in |
| 497 | 0, // in_off |
| 498 | handle.availInBefore, // in_len |
| 499 | self._outBuffer, // out |
| 500 | self._outOffset, // out_off |
| 501 | handle.availOutBefore); // out_len |
| 502 | } |
| 503 | |
| 504 | function processCallback() { |
| 505 | // This callback's context (`this`) is the `_handle` (ZCtx) object. It is |