关于网络字节序(network byte order)和主机字节序(host byte order)

在网络传输中,采用big-endian序,对于0x0A0B0C0D,传输顺序就是0A 0B 0C 0D,因此big-endian作为network byte order,little-endian作为host byte order

为什么X86存储会使用little-endian,起初我想对于位运算,尤其是位移运算,little-endian很方便,但转念一想,big-endian也方便啊,无非是左移和右移的区别而已,但little-endian的优势在于unsigned char/short/int/long类型转换时,存储位置无需改变。

posted on 2009-11-03 16:28  jiahuafu  阅读(450)  评论(0编辑  收藏  举报

导航