Solved

Reading and writing integers to file in big-endian order

Posted on 2004-10-05
3
407 Views
Last Modified: 2008-02-01
Hello,

I need to read and write integers (4 byte) from/to a file in big-endian order.  What is the best way to change the byte order of an integer in VB.NET?  I am writing a file with unicode strings and that part was easy using the Encoding object with a BinaryReader and BinaryWriter but the integer values are more difficult.

Thanks in advance,
Rob
0
Comment
Question by:rkellow
3 Comments
 
LVL 4

Expert Comment

by:eozz_2000
ID: 12232643
big-endian?, the smallest first and the biggest last?
0
 

Author Comment

by:rkellow
ID: 12232822
The high-order byte first down to the low-order (big-endian).  This is the opposite of how Windows (Intel platforms) store values (little-endian).
0
 
LVL 8

Accepted Solution

by:
gregasm earned 500 total points
ID: 12233006
Use the BitConverter class.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question