S
sklett
I wasn't sure how to phrase the subject.
Currently I'm storing a file as a byte[] in a database, when I want to work
with the file I download the byte[] and write the data to a file on disk
then loading the file from disk and working with it in memory. Pretty
standard.
I'm now thinking that it would be MUCH better if I could somehow convert the
byte[] to the object in memory. If I was dealing with binary data I could
use BinaryFormatter (I think), but since I'm using byte[] I'm not sure hwo
to do this? Is it even possible?
Here is some pseudo code:
byte[] data = GetFileData();
FileObject fileObject = SomeMethodThatWillConvertByteDataToAnObject();
// Work with the 'deserialized' FileObject instance.
<end code sample>
Is this possible? I don't even really know what to search for?
Thanks,
Steve
Currently I'm storing a file as a byte[] in a database, when I want to work
with the file I download the byte[] and write the data to a file on disk
then loading the file from disk and working with it in memory. Pretty
standard.
I'm now thinking that it would be MUCH better if I could somehow convert the
byte[] to the object in memory. If I was dealing with binary data I could
use BinaryFormatter (I think), but since I'm using byte[] I'm not sure hwo
to do this? Is it even possible?
Here is some pseudo code:
byte[] data = GetFileData();
FileObject fileObject = SomeMethodThatWillConvertByteDataToAnObject();
// Work with the 'deserialized' FileObject instance.
<end code sample>
Is this possible? I don't even really know what to search for?
Thanks,
Steve