Below is an example of how to read from a file into a memory stream for processing.
' This code was borrowed from http://www.viiweb.com and is free to use without
' warranties or guarantees.
Public Sub readFromFile(ByVal strFileName As String, ByRef ms As MemoryStream)
Dim fs As FileStream
' open the file stream
fs = New FileStream(strFileName, FileMode.Open)
Dim br As New BinaryReader(fs)
Dim arrByte As Byte()
ms.Position = 0
While br.BaseStream.Position < br.BaseStream.Length
arrByte = br.ReadBytes(4096) ' read in 4 k at a time
ms.Write(arrByte, 0, arrByte.Length)
Tested Platform: Visual Studio .Net 2003