If you review System.IO.FileStream.Read(), the remarks section states: "An implementation is free to return fewer bytes than requested even if the end of the stream has not been reached."
You have to use the standard while loop. I know ugly as sin, but this example could fail, according to the specifications for System.IO.FileStream.Read()
//Read the stream into a byte[]
byte[] bytes = newbyte[file.InputStream.Length];
int numBytesToRead = (int)file.InputStream.Length;
int numBytesRead = 0;
while (numBytesToRead > 0)
{
// Read may return anything from 0 to numBytesToRead.
int n = file.InputStream.Read(bytes, numBytesRead, numBytesToRead);
// The end of the file is reached.
if (n == 0)
break;
numBytesRead += n;
numBytesToRead -= n;
}