17 internal class CircularBuffer
20 private int _capacity;
24 private byte[] _buffer;
27 public CircularBuffer(
int capacity)
29 Debug.Assert( capacity > 0 );
30 _buffer =
new byte[capacity];
37 public int Size {
get {
return _size; } }
41 Debug.Assert( count > 0 );
42 int trueCount = Math.Min(count, _capacity - Size);
43 for (
int i = 0;
i < trueCount; ++
i)
44 _buffer[(_tail+
i) % _capacity] = source[offset+
i];
51 public bool Put(
byte b)
53 if (Size == _capacity)
61 public int Get(
byte[] destination,
int offset,
int count)
63 int trueCount = Math.Min(count,Size);
64 for (
int i = 0;
i < trueCount; ++
i)
65 destination[offset +
i] = _buffer[(_head+
i) % _capacity];
77 int result = (
int)_buffer[_head++ % _capacity];
GLsizei GLsizei GLchar * source
GLboolean GLboolean GLboolean b
GLuint GLuint GLsizei count