StellaIndigo
IS-IT--Management
Hi
I need to read blocks of a binary data file with Visual Studio 2005.
I can't seem to find a way of checking for Eof (End of file)
looping around a FileStream ReadBytes operation. I can't find Eof values in the FileStream class and I tried to catch the possible error during ReadBytes but no error is thrown.
I need to read blocks of a binary data file with Visual Studio 2005.
I can't seem to find a way of checking for Eof (End of file)
looping around a FileStream ReadBytes operation. I can't find Eof values in the FileStream class and I tried to catch the possible error during ReadBytes but no error is thrown.
Code:
Dim arrDataBlock(128) As Byte
Dim fs As FileStream = New FileStream("c:\temp\file.dat", FileMode.OpenOrCreate)
Dim rs As System.IO.BinaryReader = New System.IO.BinaryReader(fs)
{ LOOP START here to read blocks until Eof }
arrDataBlock = rs.ReadBytes(128)
... my code to process the data block
{ LOOP ENDS }
fs.Close()
Can anyone help?
Regards
Stella
There are 10 types of people in the world. Those that understand binary and those that don't.