Ok, here''s the deal.. I have created a class representing the types of events that I would like to send over the network. I am using UDP (in Java, DatagramSocket and DatagramPacket), and I am having trouble actually putting the information into the packet.
The problem is that the constructor for DatagramPacket wants a byte array, but all my info is stored in various primitives (and a string).
What I want to do is convert them all to byte arrays, then make one large byte array to pass to the constructor.
In C, I could just memcpy the info using pointers and offsets and such, but Java has no such ability..