Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:44:56

0001 #include <cassert>
0002 
0003 #include "zlib.h"
0004 
0005 #include "Alignment/Geners/interface/ZlibHandle.hh"
0006 
0007 namespace gs {
0008   ZlibInflateHandle::ZlibInflateHandle() {
0009     strm_ = new z_stream_s();
0010     strm_->zalloc = Z_NULL;
0011     strm_->zfree = Z_NULL;
0012     strm_->opaque = Z_NULL;
0013     strm_->avail_in = 0;
0014     strm_->next_in = Z_NULL;
0015     assert(inflateInit(strm_) == Z_OK);
0016   }
0017 
0018   ZlibInflateHandle::~ZlibInflateHandle() {
0019     inflateEnd(strm_);
0020     delete strm_;
0021   }
0022 
0023   ZlibDeflateHandle::ZlibDeflateHandle(const int lev) : level_(lev) {
0024     strm_ = new z_stream_s();
0025     strm_->zalloc = Z_NULL;
0026     strm_->zfree = Z_NULL;
0027     strm_->opaque = Z_NULL;
0028     strm_->avail_in = 0;
0029     strm_->next_in = Z_NULL;
0030     assert(deflateInit(strm_, lev) == Z_OK);
0031   }
0032 
0033   ZlibDeflateHandle::~ZlibDeflateHandle() {
0034     deflateEnd(strm_);
0035     delete strm_;
0036   }
0037 }  // namespace gs