|
| | ByteBuffer (uint32_t size=0) |
| | Create a byte buffer of the given size.
|
| |
| | ~ByteBuffer () |
| | Delete this byte buffer.
|
| |
| void | resize (uint32_t size) |
| | Set the size of the buffer.
|
| |
| void | push (uint8_t data) |
| | Add a single byte to this buffer.
|
| |
| void | write (uint8_t *data, uint32_t size) |
| | Write a block of data to this ByteBuffer.
|
| |
| uint8_t | pop () |
| | Remove a byte from this buffer.
|
| |
| void | read (uint8_t *data, uint32_t size) |
| | Read a block of data from this ByteBuffer into a buffer pointed by 'data'.
|
| |
| uint32_t | size () |
| | Return the number bytes in this byte buffer.
|
| |
| uint32_t | free () |
| | Return the number of additional bytes this buffer can hold.
|
| |
| bool | full () |
| | Check if this byte buffer is full.
|
| |
| bool | empty () |
| | Check if this byte buffer is empty.
|
| |
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