1#pragma once
2
3#include <Compression/ICompressionCodec.h>
4
5namespace DB
6{
7
8class CompressionCodecDelta : public ICompressionCodec
9{
10public:
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
19protected:
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
27private:
28 UInt8 delta_bytes_size;
29};
30
31class CompressionCodecFactory;
32void registerCodecDelta(CompressionCodecFactory & factory);
33
34}
35