$ByteOrdering

$ByteOrdering

gives the native ordering of bytes in binary data on your computer system.

Details

  • Possible values of $ByteOrdering are +1 and -1.
  • +1 corresponds to big endian (appropriate for 680x0 and many other processors); -1 corresponds to little endian (appropriate for x86 processors).
  • +1 corresponds to having the most significant byte first; -1 to having the least significant byte first.
  • +1 is the order obtained from IntegerDigits[n,256].
  • $ByteOrdering gives the default setting for the ByteOrdering option in Import and Export.

Examples

Basic Examples  (2)

Byte ordering on this machine:

Read in a byte stream with reversed byte ordering:

Correct the byte ordering:

Wolfram Research (1999), $ByteOrdering, Wolfram Language function, https://reference.wolfram.com/language/ref/$ByteOrdering.html.

Text

Wolfram Research (1999), $ByteOrdering, Wolfram Language function, https://reference.wolfram.com/language/ref/$ByteOrdering.html.

CMS

Wolfram Language. 1999. "$ByteOrdering." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/$ByteOrdering.html.

APA

Wolfram Language. (1999). $ByteOrdering. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/$ByteOrdering.html

BibTeX

@misc{reference.wolfram_2024_$byteordering, author="Wolfram Research", title="{$ByteOrdering}", year="1999", howpublished="\url{https://reference.wolfram.com/language/ref/$ByteOrdering.html}", note=[Accessed: 12-October-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_$byteordering, organization={Wolfram Research}, title={$ByteOrdering}, year={1999}, url={https://reference.wolfram.com/language/ref/$ByteOrdering.html}, note=[Accessed: 12-October-2024 ]}