Definition at line 28 of file ByteBuffer.h.
◆ ByteBuffer()
Create a byte buffer of the given size.
- Parameters
-
size | Number of bytes this buffer can hold |
◆ ~ByteBuffer()
◆ resize()
void resize |
( |
uint32_t |
size | ) |
|
Set the size of the buffer.
Buffer contents are reset.
- Parameters
-
◆ push()
void push |
( |
uint8_t |
data | ) |
|
Add a single byte to this buffer.
There must be enough space in the buffer or the behavior is undefined.
- Parameters
-
◆ write()
void write |
( |
uint8_t * |
data, |
|
|
uint32_t |
size |
|
) |
| |
Write a block of data to this ByteBuffer.
There must be enough space in the ByteBuffer or the behavior is undefined.
- Parameters
-
data | Block of data to write |
size | Size of data to write |
◆ pop()
Remove a byte from this buffer.
- Returns
- data byte
◆ read()
void read |
( |
uint8_t * |
data, |
|
|
uint32_t |
size |
|
) |
| |
Read a block of data from this ByteBuffer into a buffer pointed by 'data'.
There must be enough data in the ByteBuffer or the behavior is undefined.
- Parameters
-
data | Block of data to read |
size | Size of data to read |
◆ size()
Return the number bytes in this byte buffer.
- Returns
- Number of used bytes
◆ free()
Return the number of additional bytes this buffer can hold.
- Returns
- Number of free bytes
◆ full()
Check if this byte buffer is full.
- Returns
- true if full, false otherwise
◆ empty()
Check if this byte buffer is empty.
- Returns
- true if empty, false otherwise