Serializing/deserializing involves juggling around with byte order. The functions write32(), write16(), read32() and read32() were introduced for it, but are not used everywhere (e.g. src/Opaque.cpp does not use them yet).
-> Replace the byte order handling code snippets by calls to these functions.