Click to See Complete Forum and Search --> : Reading Binary Files


Coder2008
August 16th, 2008, 11:58 PM
How can yoy tell when you have reached the end of a binary file? There does not seem to be an End Of File function for this.

darwen
August 17th, 2008, 05:22 AM
Can you post the code you're using.

Are you aware that you can do this :


string filename = "c:\\binaryfile.dat";
byte [] fileData = System.IO.File.ReadAllBytes(filename);


which reads the whole file into the byte array for you.

Darwen.

Coder2008
August 17th, 2008, 03:39 PM
Thanks for your response. This is exactly what I was looking for.