how to load a file into memory stream
Dim stream As New MemoryStream(File.ReadAllBytes(filename))
You don't need to load a file into a MemoryStream.
You can simply call File.OpenRead
to get a FileStream
containing the file.
If you really want the file to be in a MemoryStream, you can call CopyTo
to copy the FileStream to a MemoryStream.