Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
#include <cassert>

#include "Alignment/Geners/interface/BZ2Handle.hh"

namespace gs {
  BZ2InflateHandle::BZ2InflateHandle(bz_stream &strm) : strm_(&strm) {
    strm_->bzalloc = nullptr;
    strm_->bzfree = nullptr;
    strm_->opaque = nullptr;
    strm_->avail_in = 0;
    strm_->next_in = nullptr;
    assert(BZ2_bzDecompressInit(strm_, 0, 0) == BZ_OK);
  }

  BZ2InflateHandle::~BZ2InflateHandle() { assert(BZ2_bzDecompressEnd(strm_) == BZ_OK); }

  BZ2DeflateHandle::BZ2DeflateHandle(bz_stream &strm) : strm_(&strm) {
    strm_->bzalloc = nullptr;
    strm_->bzfree = nullptr;
    strm_->opaque = nullptr;
    strm_->avail_in = 0;
    strm_->next_in = nullptr;
    assert(BZ2_bzCompressInit(strm_, 9, 0, 0) == BZ_OK);
  }

  BZ2DeflateHandle::~BZ2DeflateHandle() { assert(BZ2_bzCompressEnd(strm_) == BZ_OK); }
}  // namespace gs