Class StreamFormatter<TOptions>
- 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(TOptions)
Initializes a new instance of the StreamFormatter<TOptions> class.
protected StreamFormatter(TOptions options)
Parameters
options
TOptionsThe configured options.
StreamFormatter(Action<TOptions>)
Initializes a new instance of the StreamFormatter<TOptions> class.
protected StreamFormatter(Action<TOptions> setup)
Parameters
setup
Action<TOptions>The setup delegate which need to be configured.
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
value
StreamThe string from which to deserialize the object graph.
objectType
TypeThe type of the deserialized object.
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
value
StreamThe string from which to deserialize the object graph.
objectType
TypeThe type of the deserialized object.
options
TOptionsThe configured
TOptions
.
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
value
StreamThe string from which to deserialize the object graph.
objectType
TypeThe type of the deserialized object.
setup
Action<TOptions>The
TOptions
which may be configured.
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
value
StreamThe object from which to deserialize the object graph.
Returns
- T
An object of
T
.
Type Parameters
T
The 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
value
StreamThe object from which to deserialize the object graph.
options
TOptionsThe configured
TOptions
.
Returns
- T
An object of
T
.
Type Parameters
T
The 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
value
StreamThe object from which to deserialize the object graph.
setup
Action<TOptions>The
TOptions
which may be configured.
Returns
- T
An object of
T
.
Type Parameters
T
The 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, TOptions)
Serializes the specified source
to an object of Stream.
public static Stream SerializeObject(object source, TOptions options)
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
source
ObjectThe object to serialize to Stream format.
setup
Action<TOptions>The
TOptions
which 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
source
ObjectThe object to serialize to Stream format.
objectType
TypeThe type of the object to serialize.
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
source
ObjectThe object to serialize to Stream format.
objectType
TypeThe type of the object to serialize.
options
TOptionsThe configured
TOptions
.
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
source
ObjectThe object to serialize to Stream format.
objectType
TypeThe type of the object to serialize.
setup
Action<TOptions>The
TOptions
which may be configured.