Don't forget data alignment. For example, when streaming structs it may be useful to stream out to the file system or network in packed form, then unpack to the preferred alignment of the destination architecture on streaming in.