| 369 | } |
| 370 | |
| 371 | Status InitDecompressor() { |
| 372 | EndCompressor(); |
| 373 | memset(&stream_, 0, sizeof(stream_)); |
| 374 | int ret; |
| 375 | |
| 376 | // Initialize to run either deflate or zlib/gzip format |
| 377 | int window_bits = DecompressionWindowBitsForFormat(format_, window_bits_); |
| 378 | if ((ret = inflateInit2(&stream_, window_bits)) != Z_OK) { |
| 379 | return ZlibErrorPrefix("zlib inflateInit failed: ", stream_.msg); |
| 380 | } |
| 381 | decompressor_initialized_ = true; |
| 382 | return Status::OK(); |
| 383 | } |
| 384 | |
| 385 | void EndDecompressor() { |
| 386 | if (decompressor_initialized_) { |
nothing calls this directly
no test coverage detected