2009-11-14 21:08:33 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef ZLIB_COMPRESSOR_H
|
|
|
|
#define ZLIB_COMPRESSOR_H
|
|
|
|
|
|
|
|
|
2009-11-15 21:29:53 +00:00
|
|
|
#include <zlib.h>
|
|
|
|
|
2009-11-14 21:08:33 +00:00
|
|
|
#include "ZlibCompressionBase.h"
|
|
|
|
|
|
|
|
|
2009-11-15 21:29:53 +00:00
|
|
|
class DataOutput;
|
|
|
|
|
|
|
|
|
2009-11-14 21:08:33 +00:00
|
|
|
class ZlibCompressor : public ZlibCompressionBase {
|
|
|
|
public:
|
2009-11-15 21:29:53 +00:00
|
|
|
ZlibCompressor(DataOutput* output);
|
2009-11-14 21:08:33 +00:00
|
|
|
~ZlibCompressor();
|
|
|
|
|
2009-11-15 21:29:53 +00:00
|
|
|
status_t Init();
|
|
|
|
status_t CompressNext(const void* input,
|
|
|
|
size_t inputSize);
|
|
|
|
status_t Finish();
|
|
|
|
|
|
|
|
static status_t CompressSingleBuffer(const void* input,
|
|
|
|
size_t inputSize, void* output,
|
|
|
|
size_t outputSize, size_t& _compressedSize);
|
|
|
|
|
|
|
|
private:
|
|
|
|
z_stream fStream;
|
|
|
|
DataOutput* fOutput;
|
|
|
|
bool fStreamInitialized;
|
2009-11-14 21:08:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // ZLIB_COMPRESSOR_H
|