Board index » Visual Studio » Handling binary data stream

Handling binary data stream

Visual Studio17
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


-
 

Re:Handling binary data stream

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.



en.wikipedia.org/wiki/EBCDIC">en.wikipedia.org/wiki/EBCDIC



I hope this helps somehow to find your solution



Cor





-

Re:Handling binary data stream

"Feng" <Feng@discussions.microsoft.com>schrieb:

Quote
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))

///



--

M S Herfried K. Wagner

M V P <URL:dotnet.mvps.org/>">dotnet.mvps.org/>

V B <URL:classicvb.org/petition/>">classicvb.org/petition/>



-