T_im Posted November 25, 2005 Posted November 25, 2005 Hi I'm 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 Quote
IngisKahn Posted November 25, 2005 Posted November 25, 2005 Er, how do you pass a file? Quote "Who is John Galt?"
Leaders snarfblam Posted November 26, 2005 Leaders Posted November 26, 2005 (edited) 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? Edited November 26, 2005 by snarfblam Quote [sIGPIC]e[/sIGPIC]
IngisKahn Posted November 26, 2005 Posted November 26, 2005 Ya, that was the polite way of asking. :) Quote "Who is John Galt?"
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.