A ringbuffer is a circular FIFO buffer that wraps a DataBuffer. More...
Constructors: |
|
Methods: |
Data can be added to the end of the buffer using Put, and removed from the start of the buffer using Get.
A ringbuffer can also dynamically resize itself as necessary so that Put always succeeds.
Creates a new ringbuffer with the given capacity. This is the number of bytes the buffer can store.
If dynamic is true, the ringbuffer will grow as necessary so that Put always succeeds.
Removes count bytes from the start of the ringbuffer and copies them to data/offset.
Returns the number of bytes actually transferred.
Copies count bytes from data/offset and adds them to the end of the ringbuffer.
Returns the number of bytes actually transferred.
If the buffer is dynamic, this method will reallocate the internal databuffer as necessary so that all count bytes are always added.