Class BinarySerializer
Implements functions for serializing and deserializing of objects.
Namespace: Sartorius.SAF.Serialization
Assembly: Sartorius.SAF.dll
Syntax
[Obsolete("BinaryFormatter is obsolete and a security risk.")]
public static class BinarySerializer
Methods
View SourceDeSerializeObject(ref byte[])
Deserialize a given content.
Declaration
public static object DeSerializeObject(ref byte[] bytes)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | bytes | A content as stream of bytes. |
Returns
| Type | Description |
|---|---|
| object | Content after deserialization. |
SerializeObject(object)
Serialize a given object which can be serialized.
Declaration
public static byte[] SerializeObject(object objectGraph)
Parameters
| Type | Name | Description |
|---|---|---|
| object | objectGraph | Object to Serialize |
Returns
| Type | Description |
|---|---|
| byte[] | A stream of bytes as result of a serialization or null. |
UnZipData(ref byte[])
Decompress the given bytes.
Declaration
public static void UnZipData(ref byte[] byteArray)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | byteArray |
ZipContent(ref byte[])
Compress the given bytes.
Declaration
public static void ZipContent(ref byte[] bytes)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | bytes |