示例#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;
 }