コード例 #1
0
        public virtual void TestTransferLastWrite()
        {
            var buffer = new MarshallingBuffer();

            buffer.WriteInt(Data1);
            var lastOffset = Offset(buffer);

            buffer.WriteByte(Data2);
            var other = new MarshallingBuffer();

            buffer.TransferLastWriteTo(other, true);
            Assert.AreEqual(lastOffset, Offset(buffer));
            var content = InspectContent(other);

            Assert.AreEqual(Data2, content.ReadByte());
        }