Reversing byte order in .NET

后端 未结 7 1132
天命终不由人
天命终不由人 2020-12-03 11:29

In the code below, why do X and Y take on different values than what I would think intuitively?

If the bytes 0-7 are written to the buffer, shouldn\'t the resulting

7条回答
  •  温柔的废话
    2020-12-03 12:15

    If you care about the endian-ness of your bytes, Jon Skeet wrote a class to allow you to choose the endian-order when you do the conversion.

    See C# little endian or big endian?

提交回复
热议问题