made endian conversions inline