I dont know this in detail, but in my experience with java and c++ i
needed swap the two bytes before the buffer containing the length.
the length of the buffer is sent before the buffer from java to c++
using the java byte order.
I dont know if this applies, but you should print out the first two
bytes and try swapping them. Look up my old messages or code for
details.
mike
int numBytesForDelim = sizeof(int);
coded_output->WriteVarint32(snap1.ByteSize());
This has the advantage that you can allocate a buffer of exactly the
right size, rather than adding 100 as an estimate. However, you can
also find the final size after all the writes with
CodedOutputStream::ByteCount()
You should not need to do any byte swapping if you are serializing and
deserializing integers using the protobuf API: it handles any required
byte swapping for you.
Evan
--
Evan Jones
http://evanjones.ca/