This week's book giveaway is in the Testing forum. We're giving away four copies of Data Structures the Fun Way: An Amusing Adventure with Coffee-Filled Examples and have Jeremy Kubica on-line! See this thread for details.
You need to determine the data size that is being used for char and int in the C/C++ version you are using. Then it's simply a matter of casting your java types to the right size and placing them into a byte array to be sent over the socket. From C the compiler I used in the past, char had a size of 8 bits and int had a size of 16 bits. This will give you an array of 4 bytes so you can use something like this to send a, b, 256. char a = 'a'; char b = 'b'; int c = 256; byte b = new byte; b = (byte)a; b = (byte)b; b = (byte)(c >> 8); b = (byte)c; Send the byte array b and your there.