summaryrefslogtreecommitdiff
path: root/data_buffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'data_buffer.h')
-rw-r--r--data_buffer.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/data_buffer.h b/data_buffer.h
new file mode 100644
index 0000000..c3d86e8
--- /dev/null
+++ b/data_buffer.h
@@ -0,0 +1,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();
+};
+