Beispiel #1
0
        internal (HeaderEnumerator Headers, bool IsHeader, Memory <char> PushBack) Read()
        {
            var madeProgress = true;

            while (true)
            {
                var available = Buffer.Read(Inner.Value, madeProgress);
                if (available == 0)
                {
                    if (BuilderBacking.Length > 0)
                    {
                        var inEscapedValue = ReaderStateMachine.IsInEscapedValue(StateMachine.CurrentState);
                        PushPendingCharactersToValue(inEscapedValue);
                    }
                    break;
                }
                else
                {
                    AddToPushback(Buffer.Buffer.Span.Slice(0, available));
                }

                if (AdvanceWork(available, out madeProgress))
                {
                    break;
                }
            }

            return(IsHeaderResult());
        }
Beispiel #2
0
        internal (HeaderEnumerator Headers, bool IsHeader, Memory <char> PushBack) Read()
        {
            while (true)
            {
                var available = Buffer.Read(Inner);
                if (available == 0)
                {
                    if (BuilderBacking.Length > 0)
                    {
                        PushPendingCharactersToValue();
                    }
                    break;
                }
                else
                {
                    AddToPushback(Buffer.Buffer.Span.Slice(0, available));
                }

                if (AdvanceWork(available))
                {
                    break;
                }
            }

            return(IsHeaderResult());
        }