endian safe array access