2#ifndef CHEPREP_DEFLATEOUTPUTSTREAMBUF_H
3#define CHEPREP_DEFLATEOUTPUTSTREAMBUF_H
10#ifndef CHEPREP_NO_ZLIB
34#ifndef CHEPREP_NO_ZLIB
38 inline void putUI(
unsigned int ui) {
39 unsigned char* ucp =
reinterpret_cast<unsigned char *
>(&ui);
40 unsigned int i = (
static_cast<unsigned int>(ucp[ 3 ]) << 24) +
41 (
static_cast<unsigned int>(ucp[ 2 ]) << 16) +
42 (
static_cast<unsigned int>(ucp[ 1 ]) << 8 ) +
43 (
static_cast<unsigned int>(ucp[ 0 ]));
44 buffer->sputn(
reinterpret_cast<char *
>(&i),
sizeof(
unsigned int));
47 inline void putUS(
unsigned short us) {
48 unsigned char* ucp =
reinterpret_cast<unsigned char *
>(&us);
49 unsigned short s = (
static_cast<unsigned short>(ucp[ 1 ]) << 8 ) +
50 (
static_cast<unsigned short>(ucp[ 0 ]));
51 buffer->sputn(
reinterpret_cast<char *
>(&s),
sizeof(
unsigned short));
54 inline void putUB(
unsigned char ub) {
58 inline void putS(
const std::string s) {
59 buffer->sputn(s.c_str(), s.length());
62 inline std::streampos
pos() {
76 static unsigned long crctable[256];
82#ifndef CHEPREP_NO_ZLIB
83 static const unsigned int inSize = 1000;
84 static const unsigned int outSize = 1000;
89 std::vector<char> out;
void putS(const std::string s)
void putUI(unsigned int ui)
virtual ~DeflateOutputStreamBuffer()
void putUB(unsigned char ub)
void putUS(unsigned short us)
int ZEXPORT compress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)