MsgPack.SubtreeUnpacker.ReadCore C# (CSharp) Method

ReadCore() protected method

protected ReadCore ( ) : bool
return bool
		protected override bool ReadCore()
		{
			this.DiscardCompletedStacks();

			if ( this._itemsCount.Count == 0 || !this._root.ReadSubtreeItem() )
			{
				return false;
			}

			switch ( this._root.InternalCollectionType )
			{
				case ItemsUnpacker.CollectionType.Array:
				{
					this._itemsCount.Push( this._root.InternalItemsCount );
					this._unpacked.Push( 0 );
					this._isMap.Push( false );
					break;
				}
				case ItemsUnpacker.CollectionType.Map:
				{
					this._itemsCount.Push( this._root.InternalItemsCount * 2 );
					this._unpacked.Push( 0 );
					this._isMap.Push( true );
					break;
				}
				default:
				{
					this._unpacked.Push( this._unpacked.Pop() + 1 );
					break;
				}
			}

			this._state = State.InProgress;
			return true;
		}