public void ClearBuffer(int bufferIndex) { var buffer = Buffers[bufferIndex]; var maxPosition = MaxPositionInBuffer[bufferIndex]; Array.Clear(buffer, 0, maxPosition); BufferPositions[bufferIndex] = new BufferPosition(); MaxPositionInBuffer[bufferIndex] = 0; _bufferHasBeenUsedForWrite[bufferIndex] = false; }
internal MultiBuffer(int bufferSize) { _bufferSize = bufferSize; Buffers = new byte[NumberOfBuffers][]; for (var x = 0; x < NumberOfBuffers; x++) Buffers[x] = new byte[bufferSize]; BufferPositions = new BufferPosition[NumberOfBuffers]; MaxPositionInBuffer = new int[NumberOfBuffers]; _creations = new long[NumberOfBuffers]; _bufferHasBeenUsedForWrite = new bool[NumberOfBuffers]; }
internal MultiBuffer(int bufferSize) { _bufferSize = bufferSize; Buffers = new byte[NumberOfBuffers][]; for (var x = 0; x < NumberOfBuffers; x++) { Buffers[x] = new byte[bufferSize]; } BufferPositions = new BufferPosition[NumberOfBuffers]; MaxPositionInBuffer = new int[NumberOfBuffers]; _creations = new long[NumberOfBuffers]; _bufferHasBeenUsedForWrite = new bool[NumberOfBuffers]; }
public void SetPositions(int bufferIndex, long startPosition, long endPosition) { BufferPositions[bufferIndex] = new BufferPosition(startPosition, endPosition); MaxPositionInBuffer[bufferIndex] = 0; }