
Mathias Gaunard wrote:
I personally think that there is no use in distinguishing between text and binary I/O. For I/O, you need a binary representation. To get it, you can serialize your object any way you like. This shouldn't be the job of a "binary formatting layer", even though having separate utilities to serialize/unserialize basic types to common representations would be useful (double to Little Endian IEEE 754 Double-precision for example).
I think there is definitely a need for binary I/O. It is not just a matter of serializing your objects in memory: - Is your serialized object model portable between different compilers and operating systems? If not, you need to fix a binary external data representation, and read/write it using a binary formatting layer. - Is your serialized object model compatible with serialized object models of different languages? (Suppose you need to get serialized data from C++ to Java.) If not, you need to fix a binary external data representation, and read/write it with a binary formatting layer. - Does you serialized object model map to existing binary formats (e.g. binary files like JPEG, ...). If not, you need to read/write these formats according to their specifications using a binary formatting layer. In fact, a serialization library should be built on a binary formatting layer. Best regards, -- Ares Lagae Computer Graphics Research Group, Katholieke Universiteit Leuven http://www.cs.kuleuven.be/~ares/