PC Review Forums Newsgroups Microsoft DotNet Microsoft VB .NET Re: Converting integers to Big Endian Bytes

Reply

Re: Converting integers to Big Endian Bytes

 
Thread Tools Rate Thread
Old 26-08-2003, 06:08 AM   #1
Govind
Guest
 
Posts: n/a
Default Re: Converting integers to Big Endian Bytes


Hi All,

I want to Convert 32 bit integers in to big endian byte order.. The
default is Little Endian Format..

The method is :: BitConverter.GetBytes(IntVal)

Any method is in .NET for Big Endian pls let me know...


Regards,
Govind.



  Reply With Quote
Old 26-08-2003, 10:34 AM   #2
Tom Spink
Guest
 
Posts: n/a
Default Re: Converting integers to Big Endian Bytes

He X-Posted into the DotNet newsgroups aswell, and everyone in this group is
using VB.NET :-)

--
Happy to help,
-- Tom Spink
(thomas.spink@ntlworld.com)

"Go down with your server"

http://dotnetx.betasafe.com >> On The Mend

Please respond to the newsgroup,
so all can benefit


"Rick Rothstein" <rickNOSPAMnews@NOSPAMcomcast.net> wrote in message
news:ur6u3S5aDHA.2296@TK2MSFTNGP09.phx.gbl...
> Almost everybody here is using VB6 or lower. While you may get a stray
> answer to VB.NET questions here, you should ask them in newsgroups devoted
> exclusively to .NET programming. Look for newsgroups with the word

"dotnet"
> in their name.
>
> For the news.devx.com news server, try these
>
> vb.dotnet.discussion
> vb.dotnet.technical
>
> For the microsoft news server, try these newsgroups...
>
> microsoft.public.dotnet.general
> microsoft.public.dotnet.languages.vb
>
> There are some others, but these should get you started.
>
> Rick - MVP
>
>
>
>
> "Govind" <govind_k@interworldgroup.com> wrote in message
> news:u%23tGsA5aDHA.880@TK2MSFTNGP09.phx.gbl...
> > Hi All,
> >
> > I want to Convert 32 bit integers in to big endian byte order.. The
> > default is Little Endian Format..
> >
> > The method is :: BitConverter.GetBytes(IntVal)
> >
> > Any method is in .NET for Big Endian pls let me know...
> >
> >
> > Regards,
> > Govind.
> >
> >
> >

>
>



  Reply With Quote
Old 26-08-2003, 01:07 PM   #3
Herfried K. Wagner [MVP]
Guest
 
Posts: n/a
Default Re: Converting integers to Big Endian Bytes

Hello,

"Rick Rothstein" <rickNOSPAMnews@NOSPAMcomcast.net> schrieb:
> Almost everybody here is using VB6 or lower.


Almost everybody _here_ is using VB .NET.

IMO the question whould be posted in the framework ng only:

news://news.microsoft.com/microsoft...otnet.framework

Untested:

\\\
Dim i As Integer = 12345656
Dim abyt() As Byte = BitConverter.GetBytes(i)
If BitConverter.IsLittleEndian Then
Array.Reverse(abyt)
End If
///

HTH,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet



  Reply With Quote
Old 26-08-2003, 01:47 PM   #4
Mike D Sutton
Guest
 
Posts: n/a
Default Re: Converting integers to Big Endian Bytes

> > Almost everybody here is using VB6 or lower.
>
> Almost everybody _here_ is using VB .NET.


This is what happens when people cross-post to multiple unrelated groups -
Depending on what group you're reading this in you could be writing VB
(Classic), VB.NET, C#, or any of the other .NET languages. Rick's response
was a generic .NET one given in the VB (Classic) groups, but should have
removed the .NET related groups from follow-up to avoid these kinds of
problems.

Mike


- Microsoft Visual Basic MVP -
E-Mail: EDais@mvps.org
WWW: Http://www.mvps.org/EDais/


  Reply With Quote
Old 26-08-2003, 02:45 PM   #5
Jeremy Cowles
Guest
 
Posts: n/a
Default Re: Converting integers to Big Endian Bytes

This is the problem with cross posting, the person who posted this should
have his fingers slowly eaten off and his eyes pecked out by by buzzards.


  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off