C# Class MsgPack.Serialization.NonGenericMessagePackSerializer

Inheritance: IMessagePackSingleObjectSerializer
Exibir arquivo Open project: msgpack/msgpack-cli

Public Methods

Method Description
Pack ( Stream stream, object objectTree ) : void

Serializes specified object to the Stream.

Unpack ( Stream stream ) : object

Deserialize object from the Stream.

Protected Methods

Method Description
NonGenericMessagePackSerializer ( MsgPack.Serialization.SerializationContext ownerContext, Type targetType, PackerCompatibilityOptions packerCompatibilityOptions, SerializerCapabilities capabilities ) : System

Initializes a new instance of the NonGenericMessagePackSerializer class with explicitly specified compatibility option.

This method also supports backword compatibility with 0.4.

NonGenericMessagePackSerializer ( MsgPack.Serialization.SerializationContext ownerContext, Type targetType, SerializerCapabilities capabilities ) : System

Initializes a new instance of the NonGenericMessagePackSerializer class with explicitly specified compatibility option.

PackToCore ( Packer packer, object objectTree ) : void

Serializes specified object with specified Packer.

UnpackFromCore ( Unpacker unpacker ) : object

Deserializes object with specified Unpacker.

UnpackToCore ( Unpacker unpacker, object collection ) : void

Deserializes collection items with specified Unpacker and stores them to collection.

Private Methods

Method Description
InternalPackSingleObject ( object objectTree ) : byte[]
InternalPackTo ( Packer packer, object objectTree ) : void
InternalUnpackFrom ( Unpacker unpacker ) : object
InternalUnpackSingleObject ( byte buffer ) : object
InternalUnpackTo ( Unpacker unpacker, object collection ) : void
JudgeNullable ( Type type ) : bool

Method Details

NonGenericMessagePackSerializer() protected method

Initializes a new instance of the NonGenericMessagePackSerializer class with explicitly specified compatibility option.
This method also supports backword compatibility with 0.4.
is null.
protected NonGenericMessagePackSerializer ( MsgPack.Serialization.SerializationContext ownerContext, Type targetType, PackerCompatibilityOptions packerCompatibilityOptions, SerializerCapabilities capabilities ) : System
ownerContext MsgPack.Serialization.SerializationContext A which owns this serializer.
targetType System.Type The type to be serialized.
packerCompatibilityOptions PackerCompatibilityOptions The for new packer creation.
capabilities SerializerCapabilities The capability flags for this instance.
return System

NonGenericMessagePackSerializer() protected method

Initializes a new instance of the NonGenericMessagePackSerializer class with explicitly specified compatibility option.
is null.
protected NonGenericMessagePackSerializer ( MsgPack.Serialization.SerializationContext ownerContext, Type targetType, SerializerCapabilities capabilities ) : System
ownerContext MsgPack.Serialization.SerializationContext A which owns this serializer.
targetType System.Type The type to be serialized.
capabilities SerializerCapabilities The capability flags for this instance.
return System

Pack() public method

Serializes specified object to the Stream.
/// is null. /// /// The type of is not serializable etc. ///
public Pack ( Stream stream, object objectTree ) : void
stream Stream Destination .
objectTree object Object to be serialized.
return void

PackToCore() protected abstract method

Serializes specified object with specified Packer.
/// The type of is not serializable etc. ///
protected abstract PackToCore ( Packer packer, object objectTree ) : void
packer Packer which packs values in . This value will not be null.
objectTree object Object to be serialized.
return void

Unpack() public method

Deserialize object from the Stream.
/// is null. ///
public Unpack ( Stream stream ) : object
stream Stream Source .
return object

UnpackFromCore() protected abstract method

Deserializes object with specified Unpacker.
/// Failed to deserialize object due to invalid unpacker state, stream content, or so. /// /// Failed to deserialize object due to invalid unpacker state, stream content, or so. /// /// Failed to deserialize object due to invalid unpacker state, stream content, or so. ///
protected abstract UnpackFromCore ( Unpacker unpacker ) : object
unpacker Unpacker which unpacks values of resulting object tree. This value will not be null.
return object

UnpackToCore() protected method

Deserializes collection items with specified Unpacker and stores them to collection.
/// Failed to deserialize object due to invalid unpacker state, stream content, or so. /// /// The type of is not a collection. ///
protected UnpackToCore ( Unpacker unpacker, object collection ) : void
unpacker Unpacker which unpacks values of resulting object tree. This value will not be null.
collection object Collection that the items to be stored. This value will not be null.
return void