byte-order(字节序)指在多字节数据(如 16/32/64 位整数)中,各个字节在内存或网络传输中的排列顺序。最常见的两种是大端序(big-endian)和小端序(little-endian)。(在计算机网络中常说“网络字节序”通常指大端序。)
/ˈbaɪt ˌɔːrdər/
The file format specifies byte-order for all integers.
该文件格式为所有整数规定了字节序。
When decoding the packet, convert fields from network byte-order to the host’s native byte-order to avoid incorrect values.
解码数据包时,把字段从网络字节序转换为主机本地字节序,以免出现错误数值。
byte-order由 byte(字节)+ order(顺序)构成,是计算机体系结构与网络通信中逐渐固定下来的技术术语,用来描述“多字节数值的字节排列规则”。在不同 CPU 架构与协议标准之间交换数据时,这一概念尤为关键。