convert filestream to byte[] which using for assembly.Load??

hi there,i read the article which wrote by angry ant about remote
dynamic assembly for u3d (angryant.com),i plan to use this in my project,but,
i got problem:

first i used sharpZiplib to zip my dll for simple protection,then
in my code i need to unzip the file first:

ZipInputStream inStream = new ZipInputStream(File.OpenRead(pakpath));
			 byte[] obuffer = new byte[4096];
                           inStream.GetNextEntry();
			   FileStream outStream=File.Create(unzippath);

                            //copy unzipped content to filestream
			   StreamUtils.Copy(inStream,outStream,obuffer);

codes above did the unzip job and get a Filestream “outStream” when finished, the question is C# function “Assembly.Load(byte[ ])”
pass a byte[ ] as parameter, i tried to convert FileStream to byte[ ]
which “Assembly.Load” can use but faild, any one got ideas to do this??

thanks in advance!![/code]

you can get the bytes a stream hold. for documentation on the filestream class, check out the MSDN

thanks for the fast reply,but i tried (Stream)outStream,and convert it to
byte[ ],but when using “Assembly.Load”,got error “Bad Image Format Exception …”!!!

would you please give more details?? thanks