I'm currently writing a small application that interacts with a Windows driver via a callback. This application records various XY coordinates and button states, which are expressed in integers. The application will send this this data to callback via a local network. My experience with packets is limited to say the least, but I at least know that I need to convert the values into a byte array.
For example, below are two sets of arrays:
int[][] axes = { {75, 150}, {0, 40} };
int[] buttons= {0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1}
How exactly would I go about converting these values into a byte array? Also, what use do offsets serve? I've looked around and I can't quite get my head around it.