Have you considered using a communication format such as JSON instead of raw byte RPC
For information on libraries which provide JSON for C & Java (More are available on the JSON site)
- Stack Overflow on C JSON implementation:
- JsonGlib (GNOME C JSON library referenced in the above link)
- JSON in Java
The advantages of using JSON include:
- Language independence
- Easy for machines to parse & generate
- Easy for humans to read and write (Protocol Buffers does NOT offer this)
JSON would be ideal in the case that you need to transmit object instances. If however you are truly dealing with flat binary files (that are not serialized objects) then Protocol Buffers by Google as suggested by caf will most likely be better suited (especially if they are large files).
NB: JSON requires that your byte content be encoded into a BASE64 string for transfer.