public void ConsumeTilEnd() { while (_currentFrameLenLeft != 0 || _remainingTotalBody != 0) { if (_currentFrameLenLeft != 0) { _innerStream.Seek(_currentFrameLenLeft, SeekOrigin.Current); _position += _currentFrameLenLeft; _currentFrameLenLeft = 0; if (_remainingTotalBody != 0) { ParseFrame(); // updates _currentFrameLenLeft and _remainingTotalBody } } } }