//---------------------------------------------------------------------------// #ifndef MY_LITTLE_ENDIAN #define MY_LITTLE_ENDIAN #include #define IS_BIG_ENDIAN (*(uint16_t*)"\0\xff" < 0x100) //---------------------------------------------------------------------------// class endian { private: // endianness bool little_endian_; public: // constructor endian() { // check endianness on machine little_endian_ = get_endian(); } // provide information about little versus big endian architecture bool get_endian() { // declare short (16 bit) integer representing "1" short int wd = 0x001; // get byte pattern of integer uint8_t *pwd = (uint8_t*)(&wd); //for ( int i = 0; i < 2; i ++ ) std::cout<