Class StreamFormatter<TOptions>
- Namespace
- Cuemon.Runtime.Serialization.Formatters
- Assembly
- Cuemon.Core.dll
Serializes and deserializes an object, in Stream format.
public abstract class StreamFormatter<TOptions> : Formatter<Stream>, IConfigurable<TOptions> where TOptions : class, IParameterObject, new()
Type Parameters
TOptions
- Inheritance
-
StreamFormatter<TOptions>
- Implements
-
IConfigurable<TOptions>
- Derived
- Inherited Members
Constructors
StreamFormatter()
Initializes a new instance of the StreamFormatter<TOptions> class.
protected StreamFormatter()
StreamFormatter(Action<TOptions>)
Initializes a new instance of the StreamFormatter<TOptions> class.
protected StreamFormatter(Action<TOptions> setup)
Parameters
setupAction<TOptions>The setup delegate which need to be configured.
StreamFormatter(TOptions)
Initializes a new instance of the StreamFormatter<TOptions> class.
protected StreamFormatter(TOptions options)
Parameters
optionsTOptionsThe configured options.
Properties
Options
Gets the configured options of this StreamFormatter<TOptions>.
public TOptions Options { get; }
Property Value
- TOptions
The configured options of this StreamFormatter<TOptions>.
Methods
DeserializeObject(Stream, Type)
Deserializes the specified value into an object of objectType.
public static object DeserializeObject(Stream value, Type objectType)
Parameters
valueStreamThe string from which to deserialize the object graph.
objectTypeTypeThe type of the deserialized object.
Returns
- object
An object of
objectType.
DeserializeObject(Stream, Type, Action<TOptions>)
Deserializes the specified value into an object of objectType.
public static object DeserializeObject(Stream value, Type objectType, Action<TOptions> setup)
Parameters
valueStreamThe string from which to deserialize the object graph.
objectTypeTypeThe type of the deserialized object.
setupAction<TOptions>The
TOptionswhich may be configured.
Returns
- object
An object of
objectType.
DeserializeObject(Stream, Type, TOptions)
Deserializes the specified value into an object of objectType.
public static object DeserializeObject(Stream value, Type objectType, TOptions options)
Parameters
valueStreamThe string from which to deserialize the object graph.
objectTypeTypeThe type of the deserialized object.
optionsTOptionsThe configured
TOptions.
Returns
- object
An object of
objectType.
DeserializeObject<T>(Stream)
Deserializes the specified value into an object of T.
public static T DeserializeObject<T>(Stream value)
Parameters
valueStreamThe object from which to deserialize the object graph.
Returns
- T
An object of
T.
Type Parameters
TThe type of the object to return.
DeserializeObject<T>(Stream, Action<TOptions>)
Deserializes the specified value into an object of T.
public static T DeserializeObject<T>(Stream value, Action<TOptions> setup)
Parameters
valueStreamThe object from which to deserialize the object graph.
setupAction<TOptions>The
TOptionswhich may be configured.
Returns
- T
An object of
T.
Type Parameters
TThe type of the object to return.
DeserializeObject<T>(Stream, TOptions)
Deserializes the specified value into an object of T.
public static T DeserializeObject<T>(Stream value, TOptions options)
Parameters
valueStreamThe object from which to deserialize the object graph.
optionsTOptionsThe configured
TOptions.
Returns
- T
An object of
T.
Type Parameters
TThe type of the object to return.
SerializeObject(object)
Serializes the specified source to an object of Stream.
public static Stream SerializeObject(object source)
Parameters
Returns
SerializeObject(object, Action<TOptions>)
Serializes the specified source to an object of Stream.
public static Stream SerializeObject(object source, Action<TOptions> setup)
Parameters
sourceobjectThe object to serialize to Stream format.
setupAction<TOptions>The
TOptionswhich may be configured.
Returns
SerializeObject(object, Type)
Serializes the specified source to an object of Stream.
public static Stream SerializeObject(object source, Type objectType)
Parameters
sourceobjectThe object to serialize to Stream format.
objectTypeTypeThe type of the object to serialize.
Returns
SerializeObject(object, Type, Action<TOptions>)
Serializes the specified source to an object of Stream.
public static Stream SerializeObject(object source, Type objectType, Action<TOptions> setup)
Parameters
sourceobjectThe object to serialize to Stream format.
objectTypeTypeThe type of the object to serialize.
setupAction<TOptions>The
TOptionswhich may be configured.
Returns
SerializeObject(object, Type, TOptions)
Serializes the specified source to an object of Stream.
public static Stream SerializeObject(object source, Type objectType, TOptions options)
Parameters
sourceobjectThe object to serialize to Stream format.
objectTypeTypeThe type of the object to serialize.
optionsTOptionsThe configured
TOptions.
Returns
SerializeObject(object, TOptions)
Serializes the specified source to an object of Stream.
public static Stream SerializeObject(object source, TOptions options)