Question

The documentation of BitConverter.IsLittleEndian says:

Indicates the byte order ("endianness") in which data is stored in this computer architecture.

"this" is confusing me. Say I have the following code:

Console.WriteLine(BitConverter.IsLittleEndian);

Now say I go to compile my program on my little endian machine. If I copy paste the executable onto a big endian machine, will it say false? or true? Basically I want to know if the field is a dynamic one, and if the JIT has anything to do with it.

Was it helpful?

Solution

BitConverter.IsLittleEndian indicates the architecture of the machine your binary is running on, not the one you're compiling on. It's checked entirely at runtime.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top