| 289 | } |
| 290 | |
| 291 | inline void Finish() { |
| 292 | int ret = deflate(Z(), Z_FINISH); |
| 293 | |
| 294 | while (ret == Z_OK || ret == Z_BUF_ERROR) { |
| 295 | FlushBuffer(); |
| 296 | ret = deflate(Z(), Z_FINISH); |
| 297 | } |
| 298 | |
| 299 | if (ret == Z_STREAM_END) { |
| 300 | Stream_->Write(TmpBuf(), TmpBufLen() - Z()->avail_out); |
| 301 | } else { |
| 302 | ythrow TZLibCompressorError() << "deflate finish error(" << GetErrMsg() << ")"; |
| 303 | } |
| 304 | } |
| 305 | |
| 306 | private: |
| 307 | inline unsigned char* TmpBuf() noexcept { |
no test coverage detected