Class JsonSerializer
Serializes and deserializes an object, or an entire graph of connected objects, in JSON format.
Inherited Members
Namespace: IRM.Messaging
Assembly: IRM.Json.dll
Syntax
public class JsonSerializer : ISerialize, IDeserializeUntyped
Methods
Deserialize(Stream, String)
De-serializes an object from a System.IO.Stream.
Declaration
public virtual object Deserialize(Stream input, string typeName)
Parameters
System.IO.Stream
input
The stream with the serialized object. |
String
typeName
The full name of the type. |
Returns
Object
The de-serialized object. |
Implements
Deserialize<T>(Stream)
De-serializes an object from a System.IO.Stream.
Declaration
public virtual T Deserialize<T>(Stream input)
Parameters
System.IO.Stream
input
The stream with the serialized object. |
Returns
T
The de-serialized object. |
Type Parameters
T
The type of object to de-serialize. |
Implements
GetSerializer(Type)
Gets a Newtonsoft.Json.JsonSerializer that should be used to serialize and de-serialize an object with.
Declaration
protected virtual JsonSerializer GetSerializer(Type typeToSerialize)
Parameters
System.Type
typeToSerialize
The type of object to serialize or de-serialize. |
Returns
Newtonsoft.Json.JsonSerializer
The Newtonsoft.Json.JsonSerializer to use when serialize or de-serialize the object. |
Serialize(JsonWriter, Object)
Serializes an object to a Newtonsoft.Json.JsonWriter.
Declaration
protected virtual void Serialize(JsonWriter writer, object graph)
Parameters
Newtonsoft.Json.JsonWriter
writer
The Newtonsoft.Json.JsonWriter to write the object too. |
Object
graph
The object to serialize. |
Serialize<T>(Stream, T)
Serializes an object to a System.IO.Stream.
Declaration
public virtual void Serialize<T>(Stream output, T graph)
Parameters
System.IO.Stream
output
The stream to serialize the object to. |
T
graph
The object to serialize. |
Type Parameters
T
The type of object to serialize. |