[protobuf] Java and C++ exchange via socket

2011-10-05 Thread yorick
Hello, I installed protobuf 2.4.1 on Ubuntu 10.04 64bits. I executed the example with C++ and Java and it worked fine. I'm now trying to write my own program, which is composed of two parts. I want to exchange a set of data (a message containing two fields: phi and distance) between a C++ (server

[protobuf] Re: Java and C++ exchange via socket

2011-10-05 Thread yorick
I may add a few things. I wrote the data that is send and received into text files for comparison. For the Java part, I do the following to write : - FileOutputStream output; try { output = new FileOutputStream("outputJava.txt", false); data.writeTo(output); outp

[protobuf] Re: Java and C++ exchange via socket

2011-10-06 Thread yorick
NOT initialized has not phi has not distance phi:0, distance:0 Quit ! -- So the size value is not the same... I'm suspecting that the Java "CodedOutputStream::writeRawVarint32" and the C++ "CodedInputStream::ReadVarint32" do not encode int in th

[protobuf] Re: Java and C++ exchange via socket

2011-10-06 Thread yorick
Thanks for your response. I remove the ObjectOutputStream and I changed the way of reading the socket according what you said and it works ! I can now exchange data between Java and C++. Thank you ! :) On 6 oct, 23:21, Christopher Head wrote: > On Thu, 6 Oct 2011 01:00:37 -0700 (PDT) > &g