Beispiel #1
0
        public void SerializeDelimited()
        {
            MemoryStream stream = new MemoryStream();

            TestUtil.GetAllSet().WriteDelimitedTo(stream);
            stream.WriteByte(12);
            TestUtil.GetPackedSet().WriteDelimitedTo(stream);
            stream.WriteByte(34);

            stream.Position = 0;

            TestUtil.AssertAllFieldsSet(TestAllTypes.ParseDelimitedFrom(stream));
            Assert.AreEqual(12, stream.ReadByte());
            TestUtil.AssertPackedFieldsSet(TestPackedTypes.ParseDelimitedFrom(stream));
            Assert.AreEqual(34, stream.ReadByte());
            Assert.AreEqual(-1, stream.ReadByte());
        }