Пример #1
0
        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;
        }
Пример #2
0
        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;
        }
Пример #3
0
        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];
        }
Пример #4
0
        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];
        }
Пример #5
0
 public void SetPositions(int bufferIndex, long startPosition, long endPosition)
 {
     BufferPositions[bufferIndex]     = new BufferPosition(startPosition, endPosition);
     MaxPositionInBuffer[bufferIndex] = 0;
 }
Пример #6
0
 public void SetPositions(int bufferIndex, long startPosition, long endPosition)
 {
     BufferPositions[bufferIndex] = new BufferPosition(startPosition, endPosition);
     MaxPositionInBuffer[bufferIndex] = 0;
 }