除非您花费大量时间来进行字节交换,否则就只需要清楚地编写代码即可。
Unless you spend a huge amount of time doing byte-swapping, just write the code cleanly.
如果可以选择的话,请使用标准库函数来进行字节交换操作,并按照字节在数据文件中存储的顺序进行标准化;网络字节顺序最适合这种工作。
If you have the option, use standard library functions to do byte-swapping operations, and standardize on the order in which bytes are stored in your data files; network byte order is the best.
小型传输,开销很小(固定长度的头部是2字节),协议交换最小化,以降低网络流量。
A small transport overhead (the fixed-length header is just 2 bytes), and protocol exchanges minimised to reduce network traffic.
注意:根据不同平台,以及men结构是大端字节序还是小端字节序,您可能需要交换读取字节的顺序。
Note: Depending on the platform and whether the mem structure is big endian or little endian, you may need to swap the order in which bytes are read.
零字节时间空档交换ZBTSI ?
零字节时间空档交换ZBTSI ?
应用推荐