I have some data that I'm trying to write to a certain file format. I have the description of the file format, but it's in bytes (I.E. the first 4 bytes have to be a certain set of letters, the next 4 bytes is something else, etc.). I have all the data I need, but it's in the form of strings, shorts, and a short array. I was wondering how I would go about writing them to a file as bytes to make sure the format is done correctly.
If you post the first few fields and the relevant data structure you have, we can make more concrete suggestions.
The general approach is, you'll most likely need to open the file in binary mode, use write to write individual fields for each record. You'll also need to use a binary editor to visually confirm that your output is correct, for the first few fields at least.