System.IO.Ports.SerialPortBase.AdvancePosition C# (CSharp) Méthode

AdvancePosition() protected méthode

Advances the internal circular read bufer position by specified amount and updates the valid length field accordingly.
protected AdvancePosition ( int count ) : void
count int The number of bytes to move forward.
Résultat void
        protected virtual void AdvancePosition(int count)
        {
            _incomingBufferPosition = (_incomingBufferPosition + count) % _incomingBuffer.Length;   // increase the pointer and wrap it if needed
            _incomingBufferValidLength -= count;                                                    // keep the virtual end at the same position
            if (_incomingBufferValidLength == 0)
            {
                _incomingBufferPosition = 0;
            }
        }