Prajna


StreamBaseExtension

Extensions to StreamBase to allow for custom serialization

Static members

Static memberDescription
CustomizableDeserializeToTypeName(...)
Signature: (x:StreamBase<byte> * fullname:string) -> obj

Deserialize a particular object from bytestream, allow use of customizable serializer if installed. A Guid is first read from bytestream, if it is a specific reserved NullObjectGuid, return object is null. If the GUID is DefaultSerializerGuid, BinaryFormatter is used to deserialize the object. For other GUID, installed customized deserailizer is used to deserialize the object.

CustomizableSerializeFromTypeName(...)
Signature: (x:StreamBase<byte> * obj:Object * fullname:string) -> unit

Serialize a particular object to bytestream, allow use of customizable serializer if installed. If obj is null, it is serialized to a specific reserved NullObjectGuid for null. If obj is not null, and no customized serailizer is installed, the bytestream is written as DefaultSerializerGuid + BinaryFormatter() serialized bytestream. If obj is not null, and a customized serailizer is installed, the bytestream is written as GUID_SERIALIZER + content.

DeserializeObjectWithTypeName(x)
Signature: x:StreamBase<byte> -> obj

Deserialize a particular object from bytestream, allow use of customizable serializer if one is installed.

DeserializeTo(x)
Signature: x:StreamBase<byte> -> 'U
Type parameters: 'U

x.BinaryFormatterSerializeFromTypeName( obj, typeof<'U>.FullName ) Deserialize a particular object from bytestream, allow use of customizable serializer if one is installed.

SerializeFrom(x, obj)
Signature: (x:StreamBase<byte> * obj:'U) -> unit
Type parameters: 'U

Serialize a particular object to bytestream, allow use of customizable serializer if one is installed. The customized serializer is of typeof<'U>.FullName, even the object passed in is of a derivative type.

SerializeFromWithTypeName(x, obj)
Signature: (x:StreamBase<byte> * obj:'U) -> unit
Type parameters: 'U

Serialize a particular object to bytestream, allow use of customizable serializer if one is installed. The customized serializer is of typeof<'U>.FullName, even the object passed in is of a derivative type.

SerializeObjectWithTypeName(x, obj)
Signature: (x:StreamBase<byte> * obj:Object) -> unit

Serialize a particular object to bytestream, allow use of customizable serializer if one is installed. The customized serializer is of name obj.GetType().FullName.

Fork me on GitHub