How are you determining the end of the encoded protocol buffer? What
language/data type are you using? It sounds to me like you are null
termination (perhaps with a C char*?), which isn't going to work to well
with a binary structure. Decoding with a null byte, particularly for an
integer field, shouldn't ever cause a problem with protocol buffers.

Having null bytes in the encoded bytes should be expected. In C terms,
assume the encoded data is an array of unsigned chars (so a null value is
of no particular significance).
On Jul 21, 2015 2:22 PM, "Devesh Gupta" <drax...@gmail.com> wrote:

> Hello,
>
> as per various forums it is mentioned that in serialized string can have
> null character in between.
> I just wanted to know how is protobuf able to find the end of the string
> being passed for deserialization.
>
> Actually, when i am deserialization a the string it is failing. This
> happens when the int32 value passed for serialization is 0. In case if we
> pass any value above 0 gets de-serialized successfully,
>
> I have checked the serialized string characters and in case of 0 value,
> there is a null character representing it.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to protobuf+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at http://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to