summaryrefslogtreecommitdiff
path: root/data_buffer.h
blob: c3d86e84bb892c59bc9553928200beb5f43f6e3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#pragma once

#include <cstddef>
#include <cstdint>

struct DataBuffer {
    static constexpr size_t kInitialSize = 4 * 1024;
    uint8_t *buffer{new uint8_t[kInitialSize]};
    size_t buffer_size{kInitialSize};
    size_t occupied_size{};
    void Expand(size_t new_size);
    ~DataBuffer();
};