字节序:多字节数据类型(如 16/32/64 位整数)在内存或网络中存放/传输时,各个字节排列的先后顺序。最常见的两种是大端(Big-endian,高位字节在前)和小端(Little-endian,低位字节在前)。在网络协议中常见“网络字节序”通常指大端。
/ˈbaɪt ˌɔːrdər/
The file format specifies the byte order.
该文件格式规定了字节序。
If the sender and receiver use different byte order, the program must convert integers to network byte order to avoid misreading packet fields.
如果发送方和接收方使用不同的字节序,程序就必须把整数转换为网络字节序,以免错误解读数据包字段。
“byte”指计算机中常见的 8 位数据单位;“order”意为“顺序/排列”。合起来的“byte order”就是“字节的排列顺序”。该术语在系统架构与网络通信中广泛使用,尤其用于讨论端序(endianness)及跨平台数据交换。