Lets say I have a serialized struct called MyStruct, to write it out in binary form I know that I can do this:
But lets say, instead of sending it to a file, I wanted to just serialize it directly into a byte[]. How could I do that?
Thanks...
Code:
FileStream fileStream = new FileStream(@"C:\wow.dat",FileMode.Create);
BinaryFormatter binaryFormatter = new BinaryFormatter( );
binaryFormatter.Serialize(fileStream, MyStruct);
fileStream.Close();
Thanks...