On Oct 20, 2010, at 2:13 , Kenton Varda wrote:
But you are actually writing a varint32, which can be anywhere
between 1 and 5 bytes depending on the value.
Use CodedOutputStream::Varint32Size() to compute the number of bytes
needed to encode a particular value.
This has the advantage that
On Tue, Oct 19, 2010 at 6:28 PM, Paul wrote:
> int numBytesForDelim = sizeof(int);
>
You seem to be assuming that the delimiter is a simple fixed-width int.
> coded_output->WriteVarint32(snap1.ByteSize());
>
But you are actually writing a varint32, which can be anywhere between 1 and
5 bytes
On Wed, Oct 20, 2010 at 3:28 AM, Paul wrote:
> Hi,
>
> I am sending messages from a C++ client to a Java server, but I am
> wondering about the length of the buffer I am using to send it over.
> This is the C++ code:
>
> CLIENT SIDE CODE:
> *** the protocol buffers message is called snap1 ***
>
>
Hi,
I am sending messages from a C++ client to a Java server, but I am
wondering about the length of the buffer I am using to send it over.
This is the C++ code:
CLIENT SIDE CODE:
*** the protocol buffers message is called snap1 ***
int numBytesForDelim = sizeof(int);
char *snap_buf2;
snap_buf2