Jamie,
As spamtrap suggested, you can check the size of the array returned.
If any method of BinaryReader threw an exception while I was using it, I
would not care if the position was advanced or not, as I would consider the
entire BinaryReader to be invalid and get ride of it!
Hope this helps
Jay
"jamie" <an*******@discussions.microsoft.com> wrote in message
news:0b****************************@phx.gbl...
Im trying to use a binaryreader to read in afew variables
from tcpip. The method I was trying to use was:
"ReadBytes(byval count as integer) as bytes"
But.... their explanation for the function is as follows:
A byte array containing data read from the underlying
stream. THIS MIGHT BE LESS THAT THE NUMBER OF BYTES
REQUESTED IF THE END OF THE STREAM IS REACHED.
How can I tell if I got all the bytes that I wanted, or if
it came up short?????? If it does throw an error, is the
stream pointer still advanced?
What would happen if I used readDouble and it didnt have
all the data required to create the double? Does the
stream pointer still advance? and is an exception thrown?
Thanks for all the help you ppls can give me. Unfortunatly
the nine or ten books and the vb help dont give all the
answers I need.(atleast not in english)