Shmuel,
You don't really need the BinaryReader if you simply want to read the entire
file into a byte array.
Either of the following works.
' without a BinaryReader
Dim input As New FileStream("myfile.bin", FileMode.Open)
Dim bytes(CInt(input.Length - 1)) As Byte
input.Read(bytes, 0, CInt(input.Length))
' with a BinaryReader
Dim input As New FileStream("myfile.bin", FileMode.Open)
Dim reader As New BinaryReader(input)
Dim bytes() As Byte
bytes = reader.ReadBytes(CInt(input.Length))
Hope this helps
Jay
"S Shulman" <sm*******@hotmail.com> wrote in message
news:OY**************@TK2MSFTNGP11.phx.gbl...
Hi All
I need to read a file to an array of bytes (any type of file)
I tried using FileStream and BinaryReader but it doesn't seem to work
Thank you,
Shmuel