Example #1
0
        private void WriteLink(MarshallingBuffer child, int position, int length)
        {
            int offset = Offset();

            _delegate.Seek(child.AddressInParent());
            _delegate.WriteInt(position);
            if (child.StoreLengthInLink())
            {
                _delegate.WriteInt(length);
            }
            _delegate.Seek(offset);
        }
Example #2
0
        public virtual MarshallingBuffer AddChild(bool reserveLinkSpace, bool storeLengthInLink
                                                  )
        {
            MarshallingBuffer child = new MarshallingBuffer();

            child.AddressInParent(Offset(), storeLengthInLink);
            _children = new List4(_children, child);
            if (reserveLinkSpace)
            {
                ReserveChildLinkSpace(storeLengthInLink);
            }
            return(child);
        }
Example #3
0
        public virtual void TransferLastWriteTo(MarshallingBuffer other, bool storeLengthInLink
                                                )
        {
            other.AddressInParent(_lastOffSet, storeLengthInLink);
            int length = _delegate.Offset() - _lastOffSet;

            other.PrepareWrite(length);
            int otherOffset = other._delegate.Offset();

            System.Array.Copy(_delegate._buffer, _lastOffSet, other._delegate._buffer, otherOffset
                              , length);
            _delegate.Seek(_lastOffSet);
            other._delegate.Seek(otherOffset + length);
            other._lastOffSet = otherOffset;
        }
Example #4
0
		private void WriteLink(MarshallingBuffer child, int position, int length)
		{
			int offset = Offset();
			_delegate.Seek(child.AddressInParent());
			_delegate.WriteInt(position);
			if (child.StoreLengthInLink())
			{
				_delegate.WriteInt(length);
			}
			_delegate.Seek(offset);
		}
Example #5
0
		public virtual MarshallingBuffer AddChild(bool reserveLinkSpace, bool storeLengthInLink
			)
		{
			MarshallingBuffer child = new MarshallingBuffer();
			child.AddressInParent(Offset(), storeLengthInLink);
			_children = new List4(_children, child);
			if (reserveLinkSpace)
			{
				ReserveChildLinkSpace(storeLengthInLink);
			}
			return child;
		}
Example #6
0
		public virtual void TransferLastWriteTo(MarshallingBuffer other, bool storeLengthInLink
			)
		{
			other.AddressInParent(_lastOffSet, storeLengthInLink);
			int length = _delegate.Offset() - _lastOffSet;
			other.PrepareWrite(length);
			int otherOffset = other._delegate.Offset();
			System.Array.Copy(_delegate._buffer, _lastOffSet, other._delegate._buffer, otherOffset
				, length);
			_delegate.Seek(_lastOffSet);
			other._delegate.Seek(otherOffset + length);
			other._lastOffSet = otherOffset;
		}