Just learning VB.Net and was interested in the blocking you mentioned. If I
understand correctly, the following is not guaranteed to read all the bytes:
dim fs as FileStream(myfilename, filemode.Open)
dim byt() as byte
dim r as binaryreader(fs)
byt = r.ReadBytes(fs.Length)
Do I need to use blocking to insure I get all the file into byt? I didn't
see this mentioned in the VB.Net Documentation on the binary reader class.
Jay B. Harlow said:
Herfried,
Careful! ;-)
I was thinking of mentioning you really should "block" the reads, but didn't
consider it important enough in my initial answer...
BTW: What is the "M S" in your signature? I'm on the Marklin Mailing List,
and MS refers to Mobile Station on there, not Microsoft...
Jay
Herfried K. Wagner said:
Jay,
* "Jay B. Harlow [MVP - Outlook]" <
[email protected]> scripsit:
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))
Attention!
<URL:
http://www.yoda.arachsys.com/csharp/readbinary.html>