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

2010-10-20 Thread Evan Jones
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

[protobuf] Re: Picking up the message type / description from an unknown byte[]

2010-10-20 Thread jon.mithe
Thats a great help thanks. Yeah I was thinking at the end of yesterday after playing with the UnknownFieldSet that the serialization is very tight / concise to just tags, makes sense really given what its doing. Been thinking about it this morning, probably going to go with the envelope way as I

[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

[protobuf] Compiling with Rtools

2010-10-20 Thread Travis
Hello all, I'm trying to load/save protobuf format data directly in R, so writing a R external function in C++. As visual studio doesn't support this usage, I have to compile the code with Rtools (which is essentially mingw and cygwin). However, when I try to compile it, I receive an error because

[protobuf] Re: Compiling with Rtools

2010-10-20 Thread Travis
I tested with Rtools 2.12, (or g++ (GCC) 4.5.0). The error from codecvt.h disappeared; still the error from extension_set.h remained. C:\tR CMD SHLIB test.cpp g++ -I"C:/PROGRA~1/R/R-211~1.1/include" -O2 -Wall -c test.cpp -o test.o In file included from Person.pb.h:23:0, f