一个简单的“Person”对象被解析为
Person person = new Person
{
Id = 1,
Name = "Foo",
Email = "foo@bar",
Phones = { new Person.Types.PhoneNumber { Number = "555-1212" } }
};
using (MemoryStream stream = new MemoryStream())
{
// Save the person to a stream
person.WriteTo(stream);
bytes = stream.ToArray();
}
Person copy = Person.Parser.ParseFrom(bytes);
如何解析 RepeatedField<>?
编辑:问题是是否可以通过线路发送 RepeatedFields 或者是否必须将它们捆绑在消息中才能传递?