#include <cassert>
#include <cstring>
#include <memory>
#include "zlib.h"
#include "Alignment/Geners/interface/BZ2Handle.hh"
#include "Alignment/Geners/interface/CStringStream.hh"
#include "Alignment/Geners/interface/IOException.hh"
Go to the source code of this file.
|
static void | doBZ2Compression (const char *data, const unsigned long long len, const bool defl, bz_stream &strm, char *buffer, const unsigned long long bufLen, std::ostream &sink) |
|
static void | doZlibCompression (const char *data, const unsigned long long len, const bool defl, z_stream_s &strm, char *buffer, const unsigned long long bufLen, std::ostream &sink) |
|
◆ doBZ2Compression()
static void doBZ2Compression |
( |
const char * |
data, |
|
|
const unsigned long long |
len, |
|
|
const bool |
defl, |
|
|
bz_stream & |
strm, |
|
|
char * |
buffer, |
|
|
const unsigned long long |
bufLen, |
|
|
std::ostream & |
sink |
|
) |
| |
|
static |
◆ doZlibCompression()
static void doZlibCompression |
( |
const char * |
data, |
|
|
const unsigned long long |
len, |
|
|
const bool |
defl, |
|
|
z_stream_s & |
strm, |
|
|
char * |
buffer, |
|
|
const unsigned long long |
bufLen, |
|
|
std::ostream & |
sink |
|
) |
| |
|
static |
Definition at line 11 of file CStringStream.cc.
References cms::cuda::assert(), edmScanValgrind::buffer, data, and mps_update::status.
22 strm.next_in =
reinterpret_cast<Bytef *
>(
const_cast<char *
>(
data));
25 strm.next_out =
reinterpret_cast<Bytef *
>(
buffer);
26 strm.avail_out = bufLen;
27 status = defl ? deflate(&strm, Z_FINISH) : inflate(&strm, Z_NO_FLUSH);
29 const unsigned have = bufLen - strm.avail_out;
32 throw gs::IOWriteFailure(
"In gs::doZlibCompression: sink stream failure");
33 }
while (strm.avail_out == 0);
36 assert(strm.avail_in == 0);
38 assert(deflateReset(&strm) == Z_OK);
40 assert(inflateReset(&strm) == Z_OK);
char data[epos_bytes_allocation]