On 22 December 2016 at 14:50, wrote:
> Thanks for the reply.
>
> My question here is: I use protobuffer to store a bytes data, how can I
> retrieve it back?
Symmetric to the SerializeToArray(), use ParseFromArray() or
ParseFromString() to parse a serialized version of a protocol buffer
back.
>
Thanks for the reply.
My question here is: I use protobuffer to store a bytes data, how can I
retrieve it back? In my previous example, just offset 2 from the
protobuffer data? However, the size field may vary, right?
On Thursday, December 22, 2016 at 2:13:14 PM UTC-8, Adam Cozzette wrote:
>
>
It looks like you are building up a protocol buffer containing a serialized
protocol buffer, which itself contains a serialized protocol buffer, which
in turn contains a serialized protocol buffer, etc. Each level of nesting
requires an additional two bytes: one byte for the tag number and a second
I defined a simple bytes message below
message MfStream {
bytes message=1;
}
and run a test below, in which I use for a loop to keep
serialize/deserialize the bytes message.
char buf[1024];
int tmp = 1;
MfStream testMsg;
testMsg.set_message(&tmp, sizeof(tmp));
for (int i=0; i<5; i++) {
int