More than often, we have to store object data in a device-independent way so that it can be restored later, possibly on a different machine with a different data layout and so on. In computer science, this is called serialization. Qt provides several serialization mechanisms and now we will take a brief look at some of them.
If you look at QTextStream from a distance, you will note that what it really does is serialize and deserialize data to a text format. Its close cousin is the QDataStream class that handles serialization and deserialization of arbitrary data to a binary format. It uses a custom data format to store and retrieve data from QIODevice in a platform-independent way. It stores enough data so that a stream written ...