# Meeting 20: Message Serialization

Today we are going to see various techniques for serializing objects, converting them to/from byte streams. This is a common task in concurrent programming.

• Serialization (Marshalling or Pickling)
• Deserialization (Unmarshalling or UnPickling)
• QDataStream
• Google Protocol buffers
• Exercise

Links:

## Exercise 20: QDataStream

GitHub Invitation URL: exercise20

Steps:

1. Clone the assignment for today after accepting the GitHub invitation at the link above. The repository contains three files:
• file_header.h declares a shared magic number between reader and writer code.
• read_file.cpp reads a file using a QDataStream
• write_file.cpp writes a file using a QDataStream
• CMakeLists.txt is the build configuration for the exercise. It builds two applications, read_file and write_file.
1. Build and run the applications (write_file first). Verify read_file works.

2. Modify the programs so they create a QList of QStrings and reads/writes from/to a file.

3. Recompile your applications and verify they can exchange the objects through the file.

4. Now, use git to commit the source files changed to the local repository.

5. Finally, use git push to synchronize the repository with that on GitHub.

You have completed the Exercise.