Hi,

I am trying to receive response from server which a protobuf, which is 
encoded, and there are "{" at the end of string so, I am truncating string 
using :

registerAgentResponse_string=registerAgentResponse_string.replace("{","");

then I convert this to byteArray using :

registerAgentResponse_byte =registerAgentResponse_string.getBytes("UTF-8");

and then I use:

RegisterAgentResponse.parseFrom(registerAgentResponse_byte)

RegisterAgentResponse is my protobuf.

This gives following error:

com.google.protobuf.InvalidProtocolBufferException: While parsing a 
protocol message, the input ended unexpectedly in the middle of a field. 
 This could mean either than the input has been truncated or that an 
embedded message misreported its own length.

What is it that I am doing wrong?

Thanks,
Gautam

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/protobuf/-/BTiHFpYLTvcJ.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to