applied endian conversions when writing/reading a file