haiku/headers/private/shared/ZlibDecompressor.h
Adrien Destugues 9af2105d36 Move ZlibDecompressor to libshared
* This will be used to implement compressed http streams
* Remove the custom BDataOutput class, and use BDataIO instead, for
easier integration with existing code.
2014-02-11 12:06:38 +01:00

46 lines
908 B
C++

/*
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
* Distributed under the terms of the MIT License.
*/
#ifndef _PRIVATE__ZLIB_DECOMPRESSOR_H_
#define _PRIVATE__ZLIB_DECOMPRESSOR_H_
#include <zlib.h>
#include <ZlibCompressionBase.h>
class BDataIO;
namespace BPrivate {
class ZlibDecompressor : public ZlibCompressionBase {
public:
ZlibDecompressor(BDataIO* output);
~ZlibDecompressor();
status_t Init();
status_t DecompressNext(const void* input,
size_t inputSize);
status_t Finish();
static status_t DecompressSingleBuffer(const void* input,
size_t inputSize, void* output,
size_t outputSize,
size_t& _uncompressedSize);
private:
z_stream fStream;
BDataIO* fOutput;
bool fStreamInitialized;
bool fFinished;
};
} // namespace BPrivate
#endif // _PACKAGE__HPKG__PRIVATE__ZLIB_DECOMPRESSOR_H_