8 #ifndef BOTAN_COMPRESSION_FILTER_H__
9 #define BOTAN_COMPRESSION_FILTER_H__
11 #include <botan/filter.h>
15 #if defined(BOTAN_HAS_COMPRESSION)
17 class Compression_Algorithm;
18 class Decompression_Algorithm;
23 class BOTAN_DLL Compression_Filter :
public Filter
26 void start_msg()
override;
27 void write(
const uint8_t input[],
size_t input_length)
override;
28 void end_msg()
override;
32 std::string name()
const override;
34 Compression_Filter(
const std::string&
type,
35 size_t compression_level,
36 size_t buffer_size = 4096);
38 ~Compression_Filter();
40 std::unique_ptr<Compression_Algorithm> m_comp;
41 size_t m_buffersize, m_level;
42 secure_vector<uint8_t> m_buffer;
48 class BOTAN_DLL Decompression_Filter :
public Filter
51 void start_msg()
override;
52 void write(
const uint8_t input[],
size_t input_length)
override;
53 void end_msg()
override;
55 std::string name()
const override;
57 Decompression_Filter(
const std::string&
type,
58 size_t buffer_size = 4096);
60 ~Decompression_Filter();
62 std::unique_ptr<Decompression_Algorithm> m_comp;
63 std::size_t m_buffersize;
64 secure_vector<uint8_t> m_buffer;