1#if !NETSTANDARD2_0 && !NET5_0
10using System.Runtime.Serialization;
21 private readonly NetDataContractSerializer _formatter =
22 new NetDataContractSerializer();
31 public object Deserialize(System.IO.Stream serializationStream)
33 return _formatter.Deserialize(serializationStream);
45 using var serializationStream =
new MemoryStream(buffer);
46 return _formatter.Deserialize(serializationStream);
55 public void Serialize(System.IO.Stream serializationStream,
object graph)
57 _formatter.Serialize(serializationStream, graph);
66 using var buffer =
new MemoryStream();
67 _formatter.Serialize(buffer, graph);
69 return buffer.ToArray();
Wraps the NetDataContractSerializer in the ISerializationFormatter interface so it can be used in a s...
object Deserialize(byte[] buffer)
Converts a serialization stream into an object graph.
void Serialize(System.IO.Stream serializationStream, object graph)
Converts an object graph into a byte stream.
NetDataContractSerializer Formatter
Gets a reference to the underlying NetDataContractSerializer object.
object Deserialize(System.IO.Stream serializationStream)
Converts a serialization stream into an object graph.
byte[] Serialize(object graph)
Converts an object graph into a byte stream.