Is it possible to get data of the binary serialized object ( or list of othe same objects ) as it can be done in XML or soap. Please note, I have no idea about object structure ( private and public fields,etc)? By data of the binary serialized object I mean the values of all fields.
Asked
Active
Viewed 1,123 times
1
-
Of course it is possible. You have to deserialize your object graph, then you can do with it what you want. Please write more on what you want to achieve. – Mare Infinitus Jul 21 '12 at 09:14
-
It *sounds* like you have a chunk of BF data, but don't have the class, and want to know what the data represents. Is this correct? – Marc Gravell Jul 21 '12 at 09:26
1 Answers
1
Lets say you have a stream.
object yourData;
var SerializeBinaryFileName = @"C:\Temp\binary.bf";
using (Stream stream = File.Open(SerializeBinaryFileName, FileMode.Open))
{
BinaryFormatter bformatter = new BinaryFormatter();
yourData = bformatter.Deserialize(stream);
stream.Close();
}
Then you have your object graph in the yourData variable. You can read it as any other object graph can be read.

Mare Infinitus
- 8,024
- 8
- 64
- 113