LoadFromFile
is implemented by creating a file stream, and passing that to LoadFromStream
. This, if the contents of your memory stream are the same as the contents of the file, then the call to LoadFromStream
will succeed.
Thus the only sane conclusion is that the contents of the memory stream are invalid in some way.