[Mono-dev] Endianess/serialization questions...

Steven Shaw steshaw at gmail.com
Fri Dec 30 18:43:08 EST 2005


On 12/30/05, Kornél Pál <kornelpal at hotmail.com> wrote:
> Endianness depends on the target architecture. According to CLI specs you
> cannot assume endianness. If you want to write endian-safe code use shift
> operators (<< and >>) to convert between byte arrays and integers and use
> little-endian in files. Note that BinaryReader and BinaryWriter use
> little-endian because they use shift operators.

I think this sort of answers the question.

I assume the poster is using Remoting. If using SoapFormatter I assume
that you are safe from endianess problems. If you are using
BinaryFormatter, I imagine that it uses BinaryReader/Writer and you
are also safe as it is required to be little endian.

Also possible problem could come from encoded byte arrays that your
objects reference. Can't imagine that being a problem in practise.

Cheers,
Steve.



More information about the Mono-devel-list mailing list