public void WriteSequence(int[] targetBuffer) { long bufferEnd = _bufferShift + _BufferCount; if (_lastValue < bufferEnd) { var wb = new WriteBuffer(_bufferShift, targetBuffer); long shift = _lastValue - _bufferShift; do { wb.Shift(shift); wb.WriteOne(); shift = _step; _lastValue += _step; }while (_lastValue < bufferEnd); } _bufferShift += _BufferCount; }