For a start, the word length is crucial to file size. If you're writing 8-bit binary diata with a 16-bit binary word, you waste 50% of the space straight off.
You need to look at the range of your numbers, and read the first few lines of the file with a binary-compatible file reader which can translate the numbers according to whether you suspect they are 8-bit, 16-bit or whatever. There are also different encodings - Motorola and Unix have LSB first and MSB first, just to throw you! (See also Big-endian and Little-endian).
Are you writing integers or floating-point data? Inadvertent conversion of integer to FP can double the word length and lead to inaccuracy. The reverse conversion often truncates file size with clear loss precision.
So first, define what *sort* of "binary" data you are reading and writing and how much space you want them to take up - this is akin to Format statements under good old Fortran...
Geek Speak » in reply to re: You wish!
There's Binary and Binary...
