17 #ifndef JUBATUS_CORE_COMMON_BIG_ENDIAN_HPP_
18 #define JUBATUS_CORE_COMMON_BIG_ENDIAN_HPP_
29 for (
int n =
sizeof(x) - 1; n >= 0; --n) {
30 *(buf++) = (x >> (n * 8)) & 0xff;
44 for (
size_t i = 0; i <
sizeof(x); ++i) {
45 x = (x << 8) | (buf[i] & 0xff);
54 #endif // JUBATUS_CORE_COMMON_BIG_ENDIAN_HPP_
void write_big_endian_(UInt x, char *buf)
void write_big_endian(uint32_t x, char *buf)
UInt read_big_endian(const char *buf)