Class BinarySerializationHelper
This class is used to simplify serialization/deserialization operations. Uses .NET binary serialization.
Inheritance
Namespace: Volo.Abp.Serialization.Binary
Assembly: Volo.Abp.Serialization.dll
Syntax
public static class BinarySerializationHelper : object
Methods
Deserialize(Stream)
Deserializes an object from given stream.
Declaration
public static object Deserialize(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | The stream that contains object |
Returns
| Type | Description |
|---|---|
| System.Object | deserialized object |
Deserialize(Byte[])
Deserializes an object from given byte array.
Declaration
public static object Deserialize(byte[] bytes)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | bytes | The byte array that contains object |
Returns
| Type | Description |
|---|---|
| System.Object | deserialized object |
DeserializeExtended(Stream)
Deserializes an object from given stream. Difference from Deserialize(Stream) is that; this method can also deserialize types that are defined in dynamically loaded assemblies (like PlugIns).
Declaration
public static object DeserializeExtended(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | The stream that contains object |
Returns
| Type | Description |
|---|---|
| System.Object | deserialized object |
DeserializeExtended(Byte[])
Deserializes an object from given byte array. Difference from Deserialize(Byte[]) is that; this method can also deserialize types that are defined in dynamically loaded assemblies (like PlugIns).
Declaration
public static object DeserializeExtended(byte[] bytes)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | bytes | The byte array that contains object |
Returns
| Type | Description |
|---|---|
| System.Object | deserialized object |
Serialize(Object)
Serializes an object and returns as a byte array.
Declaration
public static byte[] Serialize(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | obj | object to be serialized |
Returns
| Type | Description |
|---|---|
| System.Byte[] | bytes of object |
Serialize(Object, Stream)
Serializes an object into a stream.
Declaration
public static void Serialize(object obj, Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | obj | object to be serialized |
| Stream | stream | Stream to serialize in |