[Mono-devel-list] BitConverter on big-endian-Systems (xScale?)
Robert Shade
rshade at dvsconsulting.com
Mon Mar 8 20:33:25 EST 2004
On OS X:
0 0 b1 f3
rob
On Mar 8, 2004, at 3:49 AM, Stefan Mecke wrote:
> using System;
>
> public class Test
> {
> public static void Main(string[] args)
> {
> if (!BitConverter.IsLittleEndian){
> byte[] ba;
> int i4 = 45555;
>
> ba = BitConverter.GetBytes(i4);
>
> for (int i=0; i<ba.Length; i++)
> {
> Console.Write(" {0:x}", ba[i]);
> }
> Console.WriteLine();
> } else {
> Console.WriteLine("Little-endian-platform -- doesn't help");
> }
> }
> }
More information about the Mono-devel-list
mailing list