开发者

BitConvert.IsLittleEndianon on different endian architectures

开发者 https://www.devze.com 2023-03-05 11:06 出处:网络
The documentation of Bit开发者_如何学PythonConverter.IsLittleEndian says: Indicates the byte order (\"endianness\") in which data is stored in this computer architecture.

The documentation of Bit开发者_如何学PythonConverter.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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号