public virtual void TestTransferLastWrite() { MarshallingBuffer buffer = new MarshallingBuffer(); buffer.WriteInt(Data1); int lastOffset = Offset(buffer); buffer.WriteByte(Data2); MarshallingBuffer other = new MarshallingBuffer(); buffer.TransferLastWriteTo(other, true); Assert.AreEqual(lastOffset, Offset(buffer)); ByteArrayBuffer content = InspectContent(other); Assert.AreEqual(Data2, content.ReadByte()); }