I am trying to produce a
java client to an existing server written in C. The server currently has several clients also written in C, and various messages have been defined (as C structures containing int and char[] etc) which pass between client and server via read/write calls.
I am having problems designing a solution, I could read the message as a byte[], but was unsure how to translate a sequence of bytes into an int for example (Big Endian or little Endian ?), I could translate a sequence of bytes representing a C null terminated
string into a Java String easily enough but the whole mechanism would be quite slow for large volumes of data.
I also wondered if there were convenience classes (in the public domain) which could be used to read/write such messages from within a java program, I would have thought this sort of thing was quite common.