I have a web service application inwhich I serialize,compress, and encrypt
data. Upto this point the data I work with exposes its own serialize method
so I can both serialize and deserialize the data from and to it parent
application. Now I am interested in serializing other files, in particular
large media files .wmv, .wma. I guesss this question would also extend to
how to serialize and deserialize data to and from power point, project, word
files, etc.

What I am after is the procedure and code for serializeing application files
such a .wmv. Here is where I am at present,

Dim MyObject as Object = "C:\MedialFiles\BigVideo.wmv" or BigFile.doc or
BiggerFiler.xls,etc
Dim DataByteArray() as byte
Dim ms as New MemoryStream
Dim bf as BinaryFormatter
bf.serialize(ms,MyObject)
ms.position=0
ms.write(DataByteArray,0,cint(ms.length))
ms.close

At this point, I would compress and encrypt the byte array and send it to my
web server for storage. Where I am confused is when I recall the data from
my web service and deompress/decrypt the data back to the origional
application file that can be played by Window Media Player.

Here is where I am stuck, I have just downloaded the bytearray from the web
service

dim ms as new MemoryStream
dim bf as binaryformatter
ms.read(databytearray,0,cint(databytearray.lenght)

Here is where I am confused. I need to be able to deserialize the recalled
data into something that my application, in this case Window Media Play can
open and play.

So in short, how do you serialize and then deserialize application files?

Thanks,
Fred Herring