Network Byte Order

The way bytes are ordered in multi-byte integers can vary from platform to platform. The bytes of the integer value of 0x12345678 could be stored in memory in that order with the most significant byte occurring at a lower address. This is called big endian because the big part of the integer (the most significant byte) occurs first. The same value could also be stored in little-endian byte order as 0x78563412; here, the least significant byte comes first. The PowerPC stored its integers in big endian byte order, while Intel x86 machines store integers in little endian byte order. The two parties communicating must agree on what order the specific bytes will have when transferring integers between machines over the network. ...

Get Advanced Mac OS X Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.