Using protobuf CodedInputStream to read from byte[]
问题 In the following code i want to use a predefined protobuf message in c#. I found that I was able to write and use the method to take a method that has been created and make a byte[] : ContainerMessage containerMessage = new ContainerMessage(); containerMessage.Type = CommandType.Connect; containerMessage.Connect = new Connect(); containerMessage.Connect.ClientName = "TemporaryClientName"; byte[] stream = new byte[containerMessage.CalculateSize()]; using (Google.Protobuf.CodedOutputStream