msgpack / msgpack-cli

MessagePack implementation for Common Language Infrastructure / msgpack.org[C#]
http://msgpack.org
Apache License 2.0
835 stars 175 forks source link

Does double serialization supports BigEndian environment? #213

Closed neuecc closed 7 years ago

neuecc commented 7 years ago

I've read packing double code. Pack single code has branches by IsLittleEndian but pack double code has not. https://github.com/msgpack/msgpack-cli/blob/master/src/MsgPack/Packer.Packing.cs#L1108-L1123 Does this support BigEndian?

yfakariya commented 7 years ago

Yes. For Single, I implemented encoding using pointer operation effectively, so it is required to reverse the order when it runs on little endian machine. In oposite, other numerics, including Double, use shift operator which abstracts endian.

neuecc commented 7 years ago

Thank you and sorry, I've missed shift operator(sorry for no consideration question).