예제 #1
0
		private SubtreeUnpacker( StreamUnpacker root, SubtreeUnpacker parent )
		{
			Contract.Assert( root != null );
			Contract.Assert( root.IsArrayHeader || root.IsMapHeader );
			this._root = root;
			this._parent = parent;
			this._unpacked = new Stack<long>( 2 );

			this._itemsCount = new Stack<long>( 2 );
			this._isMap = new Stack<bool>( 2 );

			if ( root.ItemsCount > 0 )
			{
				this._itemsCount.Push( root.ItemsCount * ( root.IsMapHeader ? 2 : 1 ) );
				this._unpacked.Push( 0 );
				this._isMap.Push( root.IsMapHeader );
			}
		}
예제 #2
0
		public SubtreeUnpacker( StreamUnpacker parent ) : this( parent, null ) { }