void zdecompress( uint8_t * const in, unsigned int const inlen, char * const out, unsigned int const outlen ) { zreset(); zintf->setAvailIn(inlen); zintf->setNextIn(in); zintf->setAvailOut(outlen); zintf->setNextOut(reinterpret_cast<Bytef *>(out)); int const r = zintf->z_inflate(Z_FINISH); bool ok = (r == Z_STREAM_END) && (zintf->getAvailOut() == 0) && (zintf->getAvailIn() == 0); if ( !ok ) { ::libmaus2::exception::LibMausException se; se.getStream() << "BgzfInflateZStreamBase::zdecompress(): inflate failed"; se.finish(); throw se; } }
void zdecompress( uint8_t * const in, unsigned int const inlen, char * const out, unsigned int const outlen ) { zreset(); inflatestrm.avail_in = inlen; inflatestrm.next_in = in; inflatestrm.avail_out = outlen; inflatestrm.next_out = reinterpret_cast<Bytef *>(out); int const r = inflate(&inflatestrm,Z_FINISH); bool ok = (r == Z_STREAM_END) && (inflatestrm.avail_out == 0) && (inflatestrm.avail_in == 0); if ( !ok ) { ::libmaus2::exception::LibMausException se; se.getStream() << "BgzfInflate::decompressBlock(): inflate failed"; se.finish(); throw se; } }