c# binaryformatter - i out category binary data?


i wish deserialize an vigilant nonetheless don't know category adult front. so, cruise following code...



iformatter formatter = new binaryformatter();
stream tide = new filestream("myfile.bin", filemode.open, fileaccess.read, fileshare.read);
myobject obj = (myobject)formatter.deserialize(stream);


what i i don't know category adult front? say, instance "myfile.bin" myobject myfoo. i establish vigilant instantiate?



something like...



if (magic happens here == typeof(myobject))  
myobject obj = (myobject) formatter.deserialize(stream);
else (more incantation happens here == typeof(myfoo))
myfoo foo = (myfoo)formatter.deserialize(stream);


Comments

Popular posts from this blog

list macos calm editors formula editors

how hibernate @any-related annotations?

why does floated <input> control floated component slip over too distant right ie7, nonetheless firefox?