BitStream
Loading...
Searching...
No Matches
byte_buffer.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4#include <cstdint>
5
6namespace bitstream
7{
13 template<size_t Size>
15 {
16 static_assert(Size % 4 == 0, "Buffer size must be a multiple of 4");
17
18 alignas(uint32_t) uint8_t Bytes[Size];
19
20 uint8_t& operator[](size_t i) noexcept { return Bytes[i]; }
21 };
22}
Definition bounded_range.h:28
A byte buffer aligned to 4 bytes. Can be used with bit_reader and bit_writer.
Definition byte_buffer.h:15
uint8_t & operator[](size_t i) noexcept
Definition byte_buffer.h:20
uint8_t Bytes[Size]
Definition byte_buffer.h:18