[protobuf] Re: buffer sizes when sending messages from c++ to java

2014-07-26 Thread Anthony Seo
So how do you change the code: ZeroCopyOutputStream* raw_output = new ArrayOutputStream(snap_buf2, snap1.ByteSize()+numBytesForDelim); //Here? CodedOutputStream* coded_output = new CodedOutputStream(raw_output); coded_output->WriteVarint32(snap1.ByteSize()); //Here? snap1.Serialize

[protobuf] Re: buffer sizes when sending messages from c++ to java

2010-10-20 Thread Paul
ok thanks a lot guys! both ByteCount() and VarintSize32() worked for me! Paul On Oct 20, 3:13 am, Evan Jones wrote: > 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