CMS 3D CMS Logo

ZlibHandle.cc
Go to the documentation of this file.
1 #include <cassert>
2 
3 #include "zlib.h"
4 
5 #include "Alignment/Geners/interface/ZlibHandle.hh"
6 
7 namespace gs {
8  ZlibInflateHandle::ZlibInflateHandle() {
9  strm_ = new z_stream_s();
10  strm_->zalloc = Z_NULL;
11  strm_->zfree = Z_NULL;
12  strm_->opaque = Z_NULL;
13  strm_->avail_in = 0;
14  strm_->next_in = Z_NULL;
15  assert(inflateInit(strm_) == Z_OK);
16  }
17 
18  ZlibInflateHandle::~ZlibInflateHandle() {
19  inflateEnd(strm_);
20  delete strm_;
21  }
22 
23  ZlibDeflateHandle::ZlibDeflateHandle(const int lev) : level_(lev) {
24  strm_ = new z_stream_s();
25  strm_->zalloc = Z_NULL;
26  strm_->zfree = Z_NULL;
27  strm_->opaque = Z_NULL;
28  strm_->avail_in = 0;
29  strm_->next_in = Z_NULL;
30  assert(deflateInit(strm_, lev) == Z_OK);
31  }
32 
33  ZlibDeflateHandle::~ZlibDeflateHandle() {
34  deflateEnd(strm_);
35  delete strm_;
36  }
37 } // namespace gs
Definition: AbsArchive.cc:45