10using System.Runtime.Serialization.Formatters.Binary;
23 private readonly BinaryFormatter _formatter =
24 new BinaryFormatter();
33 public object Deserialize(System.IO.Stream serializationStream)
35 return _formatter.Deserialize(serializationStream);
47 using var serializationStream =
new MemoryStream(buffer);
48 return _formatter.Deserialize(serializationStream);
57 public void Serialize(System.IO.Stream serializationStream,
object graph)
59 _formatter.Serialize(serializationStream, graph);
68 using var buffer =
new MemoryStream();
69 _formatter.Serialize(buffer, graph);
71 return buffer.ToArray();