How to append object to a file while serializing using c# protobuf-net?
问题 I got a source code of Protobuf-net that serializes an object to a file. var person = new Person { Id = 12345, Name = "Fred", Address = new Address { Line1 = "Flat 1", Line2 = "The Meadows" } }; using (var file = File.Create("person.bin")) { ProtoBuf.Serializer.Serialize(file, person); } But suppose i have two instance of Person that i want to serialize into a single file. how can i do that? 回答1: protobuf, in the pure sense, does not have any "terminator" except the end of a file (this is so