Handling binary data stream

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Feng

    #1

    Handling binary data stream

    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
  • Cor Ligthert [MVP]

    #2
    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.



    I hope this helps somehow to find your solution

    Cor


    Comment

    • Herfried K. Wagner [MVP]

      #3
      Re: Handling binary data stream

      "Feng" <Feng@discussio ns.microsoft.co m> schrieb:[color=blue]
      > 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.[/color]

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

      --
      M S Herfried K. Wagner
      M V P <URL:http://dotnet.mvps.org/>
      V B <URL:http://classicvb.org/petition/>

      Comment

      Working...