bool EndContainer() { ResetState(DecodeState.Tag); if (_containerStack.Count != 0) { var container = _containerStack.Pop(); Debug.Assert(container == _currentContainer); Tag = container.Tag; Type = container.Type; Length = container.Length; IsContainer = true; OnItemReady(); if (_containerStack.Count != 0) { _currentContainer = _containerStack.Peek(); _currentContainer.BytesRead += Length; } else { _currentContainer = null; } DisposeCurrentTlv(); return(true); } return(false); }
void PushContainer() { _currentContainer = new AsyncContainer(Tag, Type, Length); _containerStack.Push(_currentContainer); }