Class CircularBuffer
A very basic circular buffer implementation
public class CircularBuffer
- Inheritance
-
CircularBuffer
- Inherited Members
Constructors
CircularBuffer(int)
Create a new circular buffer
public CircularBuffer(int size)
Parameters
size
intMax buffer size in bytes
Properties
Count
Number of bytes currently stored in the circular buffer
public int Count { get; }
Property Value
MaxLength
Maximum length of this circular buffer
public int MaxLength { get; }
Property Value
Methods
Advance(int)
Advances the buffer, discarding bytes
public void Advance(int count)
Parameters
count
intBytes to advance
Read(byte[], int, int)
Read from the buffer
public int Read(byte[] data, int offset, int count)
Parameters
Returns
- int
Number of bytes actually read
Reset()
Resets the buffer
public void Reset()
Write(byte[], int, int)
Write data to the buffer
public int Write(byte[] data, int offset, int count)
Parameters
Returns
- int
number of bytes written