1 | #pragma once |
---|---|
2 | |
3 | #include <Compression/ICompressionCodec.h> |
4 | |
5 | namespace DB |
6 | { |
7 | |
8 | class CompressionCodecDelta : public ICompressionCodec |
9 | { |
10 | public: |
11 | CompressionCodecDelta(UInt8 delta_bytes_size_); |
12 | |
13 | UInt8 getMethodByte() const override; |
14 | |
15 | String getCodecDesc() const override; |
16 | |
17 | void useInfoAboutType(DataTypePtr data_type) override; |
18 | |
19 | protected: |
20 | UInt32 doCompressData(const char * source, UInt32 source_size, char * dest) const override; |
21 | |
22 | void doDecompressData(const char * source, UInt32 source_size, char * dest, UInt32 uncompressed_size) const override; |
23 | |
24 | UInt32 getMaxCompressedDataSize(UInt32 uncompressed_size) const override { return uncompressed_size + 2; } |
25 | |
26 | |
27 | private: |
28 | UInt8 delta_bytes_size; |
29 | }; |
30 | |
31 | class CompressionCodecFactory; |
32 | void registerCodecDelta(CompressionCodecFactory & factory); |
33 | |
34 | } |
35 |