CMS 3D CMS Logo

BZ2Handle.cc
Go to the documentation of this file.
1 #include <cassert>
2 
3 #include "Alignment/Geners/interface/BZ2Handle.hh"
4 
5 namespace gs {
6  BZ2InflateHandle::BZ2InflateHandle(bz_stream& strm)
7  : strm_(&strm)
8  {
9  strm_->bzalloc = nullptr;
10  strm_->bzfree = nullptr;
11  strm_->opaque = nullptr;
12  strm_->avail_in = 0;
13  strm_->next_in = nullptr;
14  assert(BZ2_bzDecompressInit(strm_, 0, 0) == BZ_OK);
15  }
16 
17  BZ2InflateHandle::~BZ2InflateHandle()
18  {
19  assert(BZ2_bzDecompressEnd(strm_) == BZ_OK);
20  }
21 
22  BZ2DeflateHandle::BZ2DeflateHandle(bz_stream& strm)
23  : strm_(&strm)
24  {
25  strm_->bzalloc = nullptr;
26  strm_->bzfree = nullptr;
27  strm_->opaque = nullptr;
28  strm_->avail_in = 0;
29  strm_->next_in = nullptr;
30  assert(BZ2_bzCompressInit(strm_, 9, 0, 0) == BZ_OK);
31  }
32 
33  BZ2DeflateHandle::~BZ2DeflateHandle()
34  {
35  assert(BZ2_bzCompressEnd(strm_) == BZ_OK);
36  }
37 }
Definition: AbsArchive.cc:53