2#ifndef CHEPREP_DEFLATEOUTPUTSTREAMBUF_H
3#define CHEPREP_DEFLATEOUTPUTSTREAMBUF_H
10#ifndef CHEPREP_NO_ZLIB
35#ifndef CHEPREP_NO_ZLIB
39 inline void putUI(
unsigned int ui) {
40 unsigned char* ucp =
reinterpret_cast<unsigned char *
>(&ui);
41 unsigned int i = (
static_cast<unsigned int>(ucp[ 3 ]) << 24) +
42 (
static_cast<unsigned int>(ucp[ 2 ]) << 16) +
43 (
static_cast<unsigned int>(ucp[ 1 ]) << 8 ) +
44 (
static_cast<unsigned int>(ucp[ 0 ]));
45 buffer->sputn(
reinterpret_cast<char *
>(&i),
sizeof(
unsigned int));
48 inline void putUS(
unsigned short us) {
49 unsigned char* ucp =
reinterpret_cast<unsigned char *
>(&us);
50 unsigned short s = (
static_cast<unsigned short>(ucp[ 1 ]) << 8 ) +
51 (
static_cast<unsigned short>(ucp[ 0 ]));
52 buffer->sputn(
reinterpret_cast<char *
>(&s),
sizeof(
unsigned short));
55 inline void putUB(
unsigned char ub) {
59 inline void putS(
const std::string s) {
60 buffer->sputn(s.c_str(), s.length());
63 inline std::streampos
pos() {
77 static unsigned long crctable[256];
83#ifndef CHEPREP_NO_ZLIB
84 static const unsigned int inSize = 1000;
85 static const unsigned int outSize = 1000;
90 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)