ProtoBuf.Net: Generic reader

2009-09-29 Thread test.f...@nomail.please
Is there a way to generically read a protoBuf byte[] and extract a field tag/name to value mapping? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to

Re: Protobuf-net Serialize problem

2009-04-03 Thread test.f...@nomail.please
Marc, The server is using ProtoBuf 2.0.1. I had to upgrade my .net version to the latest protobuf-net in order to have protogen work with optional fields correctly. It seems that the server only processes bytes up to the 1st NULL char when calling ParseFromString. Will this problem be avoided

Re: Protobuf-net Serialize problem

2009-04-02 Thread test.f...@nomail.please
It seems I was wrong in trying to use ASCII or UTF-8 encoding. This works. private string Serialize(OrderProto proto) { using (MemoryStream stream = new MemoryStream()) { Serializer.SerializeOrderProto(stream, proto); using

Re: Protobuf-net Serialize problem

2009-04-02 Thread test.f...@nomail.please
= new char[stream.Length]; for (int i = 0; i stream.Length; i++) chars[i] = reader.ReadChar(); return new string(chars); } } } Thanks On Apr 2, 1:04 pm, test.f...@nomail.please test.f...@gmail.com

Protobuf-net Serialize problem

2009-04-01 Thread test.f...@nomail.please
Does someone have a Serialize sample for protobuf-net? I'm using VS 2005/C#. When I try Encoding.ASCII.GetBytes() and Encoding.ASCII.GetString(), I get an exception invalid wire type - 7. If I Convert.FromBase64String, serialize/deserialize works but the message is rejected by the server which