serialization for C/C++ to pass messages as byte strings, should be compatible with java way of doing that