David,
Thank You.
Chris
"David Kline [msft]" <(E-Mail Removed)> wrote in message
news:gNYsb.144067$275.440806@attbi_s53...
> Chris,
>
> You should be able to use the BitConverter to convert your doubles to
longs
> through byte arrays (ex: long l =
> BitConverter.ToInt64(BitConverter.GetBytes(double)); ) and then convert
them
> between host and network order using IPAddress.HostToNetworkOrder() and
> IPAddress.NetworkToHostOrder().
>
> Hope this helps,
> David Kline
> Microsoft .NET Compact Framework
>
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
>
> "Chris P" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > I am reading bytes from a serial port which come from a device which
uses
> > the Big-Endian storage format. My question is, can I use the
> > BitConverter.ToDouble(bytearray, position) method to convert those bytes
> to
> > a double? In other words, will the system take into account that the
byte
> > order needs to be swapped?
> >
> > Conversely, I need to write longs and double to the serial device in
> > Big-Endian format. How would I do that?
> >
> > Thanks,
> >
> > Chris
> >
> >
>
>
|