C# Class Amnesia.SerializationUtil

Datei anzeigen Open project: vc3/Amnesia

Public Methods

Method Description
Deserialize ( byte data ) : object

Utility method for de-serializing objects into a binary format Serialize(object)

Deserialize ( byte data, ISurrogateSelector selector ) : object

Utility method for de-serializing objects into a binary format Serialize(object, ISurrogateSelector)

DeserializeBase64 ( string data ) : object

Utility method for de-serializing objects from a base64 format. SerializeBase64(object). Null object references will be deserialized correctly without causing an exception.

DeserializeBase64 ( string data, ISurrogateSelector selector ) : object

Utility method for de-serializing objects from a base64 format. SerializeBase64(object, ISurrogateSelector). Null object references will be deserialized correctly without causing an exception.

EnableCyclicalReferences ( ISerializationSurrogate surrogate ) : ISerializationSurrogate

Wraps an ISerializationSurrogate surrogate with special one to enable cyclical references during serialization if hotfix http://support.microsoft.com/kb/931634, or later is installed. Wrapping the surrogate should fix the "The object with ID X was referenced in a fixup but does not exist." error that occurs during deserialization.

MakeSerializable ( Delegate d ) : Delegate

Removes non-public method targets from a delegate so that they can be safely serialized.

Serialize ( object o ) : byte[]

Utility method for serializing objects into a binary format. Deserialize(byte[])

Serialize ( object o, ISurrogateSelector selector ) : byte[]

Utility method for serializing objects into a binary format. Deserialize(byte[], ISurrogateSelector)

SerializeBase64 ( object o ) : string

Utility method for serializing objects into a base64 format. DeserializeBase64(string). Null object references will be serialized correctly without causing an exception.

SerializeBase64 ( object o, ISurrogateSelector selector ) : string

Utility method for serializing objects into a base64 format. DeserializeBase64(string, ISurrogateSelector). Null object references will be serialized correctly without causing an exception.

Private Methods

Method Description
SerializeToFixedByteArray ( object o, ISurrogateSelector selector ) : FixedByteArray

Method Details

Deserialize() public static method

Utility method for de-serializing objects into a binary format Serialize(object)
public static Deserialize ( byte data ) : object
data byte
return object

Deserialize() public static method

Utility method for de-serializing objects into a binary format Serialize(object, ISurrogateSelector)
public static Deserialize ( byte data, ISurrogateSelector selector ) : object
data byte
selector ISurrogateSelector
return object

DeserializeBase64() public static method

Utility method for de-serializing objects from a base64 format. SerializeBase64(object). Null object references will be deserialized correctly without causing an exception.
public static DeserializeBase64 ( string data ) : object
data string
return object

DeserializeBase64() public static method

Utility method for de-serializing objects from a base64 format. SerializeBase64(object, ISurrogateSelector). Null object references will be deserialized correctly without causing an exception.
public static DeserializeBase64 ( string data, ISurrogateSelector selector ) : object
data string
selector ISurrogateSelector
return object

EnableCyclicalReferences() public static method

Wraps an ISerializationSurrogate surrogate with special one to enable cyclical references during serialization if hotfix http://support.microsoft.com/kb/931634, or later is installed. Wrapping the surrogate should fix the "The object with ID X was referenced in a fixup but does not exist." error that occurs during deserialization.
public static EnableCyclicalReferences ( ISerializationSurrogate surrogate ) : ISerializationSurrogate
surrogate ISerializationSurrogate
return ISerializationSurrogate

MakeSerializable() public static method

Removes non-public method targets from a delegate so that they can be safely serialized.
public static MakeSerializable ( Delegate d ) : Delegate
d System.Delegate The multicast or singlecast delegate to process
return System.Delegate

Serialize() public static method

Utility method for serializing objects into a binary format. Deserialize(byte[])
public static Serialize ( object o ) : byte[]
o object
return byte[]

Serialize() public static method

Utility method for serializing objects into a binary format. Deserialize(byte[], ISurrogateSelector)
public static Serialize ( object o, ISurrogateSelector selector ) : byte[]
o object
selector ISurrogateSelector
return byte[]

SerializeBase64() public static method

Utility method for serializing objects into a base64 format. DeserializeBase64(string). Null object references will be serialized correctly without causing an exception.
public static SerializeBase64 ( object o ) : string
o object
return string

SerializeBase64() public static method

Utility method for serializing objects into a base64 format. DeserializeBase64(string, ISurrogateSelector). Null object references will be serialized correctly without causing an exception.
public static SerializeBase64 ( object o, ISurrogateSelector selector ) : string
o object
selector ISurrogateSelector
return string