E
Ellarco
How can I perform output (file output for the monent, possibly socket in the
future) in such a way that output produced on different compiler/machines
pairs is indistinguishable? Specifically my concern is over different byte
sizes. If I want to output say 32 bits how do I do that? If one machine has
8-bit chars then 4 of those will do but what happens when the code is run on
say a 9-bit char machine? 4 chars will output 36-bits then. There is some
way to achieve this right? The reason - the output is to be read in Java so
I want to output fixed size data so that I can simply say readInt() (32
bits), readLong() (64 bits) etc. I want binary due to the amount of data and
of course time effeciency is a concern.
Please and thank you.
future) in such a way that output produced on different compiler/machines
pairs is indistinguishable? Specifically my concern is over different byte
sizes. If I want to output say 32 bits how do I do that? If one machine has
8-bit chars then 4 of those will do but what happens when the code is run on
say a 9-bit char machine? 4 chars will output 36-bits then. There is some
way to achieve this right? The reason - the output is to be read in Java so
I want to output fixed size data so that I can simply say readInt() (32
bits), readLong() (64 bits) etc. I want binary due to the amount of data and
of course time effeciency is a concern.
Please and thank you.