|
| System.BitConverter on Big-Endian-Platforms |
|
|
|
|
| Messages |
|
Related Types |
This message was discovered on microsoft.public.dotnet.framework.compactframework.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
| Stefan Mecke |
Hi all!
Could anyone please verify and post the behavior with MS.NET compact framework on a big-endian system? The docs I found are not precise about whether BitConverter always returns the platforms native endianness or always little-endian like x86.
Thanks Stefan Mecke
-------------------------------------------------------- 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"); } } }
|
|
|
| |
|
| |
| |
| Chris Tacke, eMVP (VIP) |
CE only runs on little-endian devices.....
-- Chris Tacke, eMVP Co-Founder and Advisory Board Member www.OpenNETCF.org --- Windows CE Product Manager Applied Data Systems www.applieddata.net
"Stefan Mecke" <Click here to reveal e-mail address> wrote in message news:c2su38$20q0l1$Click here to reveal e-mail address... [Original message clipped]
|
|
|
| |
|
|
| |
| |
| Steven |
If you have need to read data produced by a big-endian system (such as a Palm database file), you might do as I did under the same circumstances. I read the data into bytes arrays one field/value at a time and manually reversed the bytes in the array. I then passed the reversed bytes into bitconverter. I have had no trouble reading Palm databases this way for quite a while.
|
|
|
| |
|
|
| |
| |
| Chris Tacke, eMVP (VIP) |
Ah! Can't see the forest for the trees, sorry.
-- Chris Tacke, eMVP Co-Founder and Advisory Board Member www.OpenNETCF.org --- Windows CE Product Manager Applied Data Systems www.applieddata.net
"Steven" <Click here to reveal e-mail address> wrote in message news:Click here to reveal e-mail address... > If you have need to read data produced by a big-endian system (such as a Palm database file), you might do as I did under the same circumstances. I read the data into bytes arrays one field/value at a time and manually reversed the bytes in the array. I then passed the reversed bytes into bitconverter. I have had no trouble reading Palm databases this way for quite a while.
|
|
|
| |
|
|
| |
|
| |
| Jamie Macleod |
That's what i do as well.
"Steven" <Click here to reveal e-mail address> wrote in message news:Click here to reveal e-mail address... > If you have need to read data produced by a big-endian system (such as a Palm database file), you might do as I did under the same circumstances. I read the data into bytes arrays one field/value at a time and manually reversed the bytes in the array. I then passed the reversed bytes into bitconverter. I have had no trouble reading Palm databases this way for quite a while.
|
|
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
BootFX
Reliable and powerful .NET application framework. |
|
|
|
|
|
|