#if !defined(HOST_USE_BIG_ENDIAN) && !defined(HOST_USE_LITTLE_ENDIAN)
#if defined(SOLARIS) || defined(_AIX) || defined(HPUX)
#define HOST_USE_BIG_ENDIAN
#elif defined(LINUX_X86)
#define HOST_USE_LITTLE_ENDIAN
#elif defined(_Windows)
#define HOST_USE_LITTLE_ENDIAN
#endif
#endif
#define __BYTE_ORDER_BIG_ENDIAN (1)
#define __BYTE_ORDER_LITTLE_ENDIAN (2)
#if defined(HOST_USE_BIG_ENDIAN)
#if defined(HOST_USE_LITTLE_ENDIAN)
#error "Both HOST_USE_BIG_ENDIAN and HOST_USE_LITTLE_ENDIAN are defined!"
#endif
#define __HOST_BYTE_ORDER __BYTE_ORDER_BIG_ENDIAN
#else
#if !defined(HOST_USE_LITTLE_ENDIAN)
#error "Either HOST_USE_BIG_ENDIAN or HOST_USE_LITTLE_ENDIAN shoule be defined!"
#endif
#define __HOST_BYTE_ORDER __BYTE_ORDER_LITTLE_ENDIAN
#endif
// to reduce CPU consumption on UNIX servers, we use big-endian
#define __OBB_BYTE_ORDER __BYTE_ORDER_BIG_ENDIAN
char* q = (char*)&listSize;
#if __HOST_BYTE_ORDER == __OBB_BYTE_ORDER
temp[0] = q[0];
temp[1] = q[1];
temp[2] = q[2];
temp[3] = q[3];
#else
temp[0] = q[3];
temp[1] = q[2];
temp[2] = q[1];
temp[3] = q[0];
#endif