Top "Endianness" questions

Endianness refers to how multi-byte values are stored in memory, sent between devices or stored on disk.

Building a 32-bit float out of its 4 composite bytes

I'm trying to build a 32-bit float out of its 4 composite bytes. Is there a better (or more portable) way …

c++ floating-point endianness portability single-precision
How to convert a Byte Array to an Int Array

I am reading a file by using: int len = (int)(new File(args[0]).length()); FileInputStream fis = new FileInputStream(args[0]); byte …

java arrays int byte endianness
Converting byte array values in little endian order to short values

I have a byte array where the data in the array is actually short data. The bytes are ordered in …

java arrays byte endianness
Is there any "standard" htonl-like function for 64 bits integers in C++?

I'm working on an implementation of the memcache protocol which, at some points, uses 64 bits integer values. These values must …

c++ 64-bit portability endianness htonl
Why is network-byte-order defined to be big-endian?

As written in the heading, my question is, why does TCP/IP use big endian encoding when transmitting data and …

networking network-protocols endianness tcp-ip
Understanding htonl() and ntohl()

I am trying to use unix sockets to test sending some udp packets to localhost. It is my understanding that …

c sockets networking endianness
Determining endianness at compile time

Is there a safe, portable way to determine (during compile time) the endianness of the platform that my program is …

c endianness
How to byte-swap a 32-bit integer in python?

Take this example: i = 0x12345678 print("{:08x}".format(i)) # shows 12345678 i = swap32(i) print("{:08x}".format(i)) # should print 78563412 What …

python integer endianness
C# - Binary reader in Big Endian?

I'm trying to improve my understanding of the STFS file format by using a program to read all the different …

c# endianness binaryreader
Can I safely assume that Windows installations will always be little-endian?

I'm writing a userspace filesystem driver on Windows and endianness conversions are something I've been dealing with, as this particular …

windows endianness