I guess SerializeToXxx() methods internally calls to ByteSize(), so after
a serialization, I can call GetCachedSize().

My question is, first, is this true? =) And second, can I rely on this?

The use case is this:

pkt.SerializeToArray(buffer, SIZE);
send(fd, buffer, pkt.GetCachedSize(), 0);

Is this safe or should I use pkt.ByteSize() instead?

Thank you.

Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
Soñé que tenia un caballo
Que me trataba mejor que vos
Tenia tan buena onda con ella
Era mi yegua, mucho mas que vos

You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 

Reply via email to