Here's an easier way to do that:
' Write byte array
My.Computer.FileSystem.WriteAllBytes(_fileName, _byte, False)
' Read byte array
_byte = My.Computer.FileSystem.ReadAllBytes(_fileName)
But if you still want to use the FileStream:
Dim _FileSize As Long
_FileSize = _file.Length
For _i As Long = 0 To _FileSize - 1
_byte(CInt(_i)) = CByte(_file.ReadByte())
Next _i
Reputation Points: 218
Solved Threads: 201
Veteran Poster
Offline 1,024 posts
since Aug 2008