1#pragma once
2
3#include <IO/WriteBuffer.h>
4
5
6/// Since HexWriteBuffer is often created in the inner loop, we'll make its buffer size small.
7#define DBMS_HEX_WRITE_BUFFER_SIZE 32
8
9
10namespace DB
11{
12
13/** Everything that is written into it, translates to HEX (in capital letters) and writes to another WriteBuffer.
14 */
15class HexWriteBuffer final : public WriteBuffer
16{
17protected:
18 char buf[DBMS_HEX_WRITE_BUFFER_SIZE]; //-V730
19 WriteBuffer & out;
20
21 void nextImpl() override;
22
23public:
24 HexWriteBuffer(WriteBuffer & out_) : WriteBuffer(buf, sizeof(buf)), out(out_) {}
25 ~HexWriteBuffer() override;
26};
27
28}
29