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); }
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); }
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; }
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); }
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; }
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; }