PATH 
ADC Home > Documentation > Hardware > Device Managers and Drivers > PCI Card Services > Designing PCI Cards and Drivers for Power Macintosh Computers


  

Byte Swapping Routines

Mac OS provides two routines that help you swap bytes between big-endian and little-endian data formats:

UInt16 EndianSwap16Bit (UInt16 data16); UInt32 EndianSwap32Bit (UInt32 data32);
data16
2-byte input.
data32
4-byte input.

EndianSwap16Bit and EndianSwap32Bit return byte swapped versions of their input values, thereby converting big-endian data to little-endian or little-endian data to big-endian.


© 1999 Apple Computer, Inc. – (Last Updated 26 March 99)