ZlibDecompressorImpl::ZlibDecompressorImpl(Stats::Scope& scope, const std::string& stats_prefix,
                                           uint64_t chunk_size)
    : Zlib::Base(chunk_size,
                 [](z_stream* z) {
                   inflateEnd(z);
                   delete z;
                 }),
      stats_(generateStats(stats_prefix, scope)) {
  zstream_ptr_->zalloc = Z_NULL;
  zstream_ptr_->zfree = Z_NULL;
  zstream_ptr_->opaque = Z_NULL;
  zstream_ptr_->avail_out = chunk_size_;
  zstream_ptr_->next_out = chunk_char_ptr_.get();
}
ZlibDecompressorImpl::ZlibDecompressorImpl(Stats::Scope& scope, const std::string& stats_prefix,
                                           uint64_t chunk_size)
    : Zlib::Base(chunk_size,
                 [](z_stream* z) {
                   inflateEnd(z);
                   delete z;
                 }),
      stats_(generateStats(stats_prefix, scope)) {
  zstream_ptr_->zalloc = Z_NULL;
  zstream_ptr_->zfree = Z_NULL;
  zstream_ptr_->opaque = Z_NULL;
  zstream_ptr_->avail_out = chunk_size_;
  zstream_ptr_->next_out = chunk_char_ptr_.get();
}