Create file from byte array

T_im

Member
Joined
May 6, 2004
Messages
7
Location
Manchester, England
Hi Im trying to create a file from a binary arrary. I can do this by saving it to disk but I need to pass the file as a reference to another class. Any ideas how I can do this without saving it to disk and then reloading it?

Cheers

Tim
 
It depends on how you are passing a file. If the function is looking for a filename, then there is no way but to write the data to a file. Many functions/constructors, however, accepts streams, in addition to filenames, as a source for data, and it is possible to create a stream on a byte array (I believe that it would be the MemoryStream class). If you provide more info, we can provide better answers. Maybe show us the declaration of the function you are calling and the data you want to pass to it?
 
Last edited by a moderator:
Back
Top