Home All Groups Group Topic Archive Search About
Author
8 Aug 2006 5:27 PM
Quinn
for some reason I can only post new message, not followups.

can you give me a small example how to read binary to byte array?

Author
8 Aug 2006 6:17 PM
Ken Halter
"Quinn" <q***@yahoo.com> wrote in message
news:eNGjS$wuGHA.1216@TK2MSFTNGP03.phx.gbl...
> for some reason I can only post new message, not followups.
>
> can you give me a small example how to read binary to byte array?

You're using Outlook Express and can't post replies to threads? How come? Is
the button "greyed" out?

--
Ken Halter - MS-MVP-VB (visiting from VB6 world) - http://www.vbsight.com
Please keep all discussions in the groups..
In Loving Memory - http://www.vbsight.com/Remembrance.htm
Author
9 Aug 2006 12:00 AM
Mythran
"Quinn" <q***@yahoo.com> wrote in message
news:eNGjS$wuGHA.1216@TK2MSFTNGP03.phx.gbl...
> for some reason I can only post new message, not followups.
>
> can you give me a small example how to read binary to byte array?
>

Dim stream As FileStream = File.OpenRead("C:\images\test.gif")

Try
    Dim reader As BinaryReader = New BinaryReader(stream)
    Dim bytes As Byte() = reader.ReadBytes(CInt(stream.Length))
Finally
    ' Cleanup.
    stream.Close()
End Try

HTH,
Mythran