I am trying to produce a
java client to a server written in C. The server currently has several existing clients also written in C, and various messages have been defined (as C structures) which are passed between client and server via read/write calls over a socket connection.
I am having problems designing an efficient means to process the messages, I could read the message as an array of bytes, 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 problem was quite common.