Handling binary data stream

G

Guest

Hi,

I need a VB.Net function that reads in a stream of binary data coming in
from a legacy data source. The data are actually hex numbers in binary format
but the problem is that I don't know how handle it in my VB program. All I
need is to be able to transform those bytes into hex, such as 'oxF9', but
right now all I can see are un-readable binary data. What is the best way to
do this kind of work?

Thanks

feng
 
C

Cor Ligthert [MVP]

Feng,

Bytes holds hex numbers, hex is nothing more than a representation of the
binary format hold in a byte.

Your problem will be to find what structure/format is used for that stream.

The worst that can happen for you can be if even instead of ASCII, EBCDIC is
used, as by instance IBM mainframes do.

http://en.wikipedia.org/wiki/EBCDIC

I hope this helps somehow to find your solution

Cor
 
H

Herfried K. Wagner [MVP]

Feng said:
All I need is to be able to transform those bytes into hex, such as
'oxF9', but
right now all I can see are un-readable binary data.

\\\
Dim i As Integer = 234234234
MsgBox("ox" & Hex(i))
MsgBox("ox" & i.ToString("X"))
MsgBox("ox" & Convert.ToString(i, 16))
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top