C# Class MsgPack.Serialization.MessagePackSerializer

Defines non-generic interface of serializers and provides entry points for MessagePackSerializer{T} usage.
You cannot derived from this class directly, use MessagePackSerializer{T} instead. This class is intended to guarantee backward compatibilities of non generic API.
Inheritance: IMessagePackSingleObjectSerializer
Show file Open project: msgpack/msgpack-cli Class Usage Examples

Public Methods

Method Description
PackSingleObject ( object objectTree ) : byte[]

Serialize specified object to the array of Byte.

PackTo ( Packer packer, object objectTree ) : void

Serialize specified object with specified Packer.

UnpackFrom ( Unpacker unpacker ) : object

Deserialize object with specified Unpacker.

UnpackFromAsync ( Unpacker unpacker, CancellationToken cancellationToken ) : Task

Deserialize object with specified Unpacker asynchronously.

UnpackSingleObject ( byte buffer ) : object

Deserialize a single object from the array of Byte which contains a serialized object.

This method assumes that buffer contains single serialized object dedicatedly, so this method does not return any information related to actual consumed bytes.

This method is a counter part of PackSingleObject.

UnpackSingleObjectAsync ( byte buffer, CancellationToken cancellationToken ) : Task

Deserialize a single object from the array of Byte which contains a serialized object.

This method assumes that buffer contains single serialized object dedicatedly, so this method does not return any information related to actual consumed bytes.

This method is a counter part of PackSingleObjectAsync.

UnpackTo ( Unpacker unpacker, object collection ) : void

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

UnpackToAsync ( Unpacker unpacker, object collection, CancellationToken cancellationToken ) : Task

Deserialize collection items with specified Unpacker and stores them to collection asynchronously.

Private Methods

Method Description
InternalGetCapabilities ( ) : SerializerCapabilities
InternalPackSingleObject ( object objectTree ) : byte[]
InternalPackSingleObjectAsync ( object objectTree, CancellationToken cancellationToken ) : Task
InternalPackTo ( Packer packer, object objectTree ) : void
InternalPackToAsync ( Packer packer, object objectTree, CancellationToken cancellationToken ) : Task
InternalUnpackFrom ( Unpacker unpacker ) : object
InternalUnpackFromAsync ( Unpacker unpacker, CancellationToken cancellationToken ) : Task
InternalUnpackSingleObject ( byte buffer ) : object
InternalUnpackSingleObjectAsync ( byte buffer, CancellationToken cancellationToken ) : Task
InternalUnpackTo ( Unpacker unpacker, object collection ) : void
InternalUnpackToAsync ( Unpacker unpacker, object collection, CancellationToken cancellationToken ) : Task
MessagePackSerializer ( MsgPack.Serialization.SerializationContext ownerContext, PackerCompatibilityOptions packerCompatibilityOptions, SerializerCapabilities capabilities ) : System

Initializes a new instance of the MessagePackSerializer class.

PackSingleObjectAsync ( object objectTree, CancellationToken cancellationToken ) : Task
PackToAsync ( Packer packer, object objectTree, CancellationToken cancellationToken ) : Task
ThrowArgumentNullException ( string parameterName ) : void

Method Details

PackSingleObject() public method

Serialize specified object to the array of Byte.
public PackSingleObject ( object objectTree ) : byte[]
objectTree object Object to be serialized.
return byte[]

PackTo() public method

Serialize specified object with specified Packer.
public PackTo ( Packer packer, object objectTree ) : void
packer Packer which packs values in .
objectTree object Object to be serialized.
return void

UnpackFrom() public method

Deserialize object with specified Unpacker.
public UnpackFrom ( Unpacker unpacker ) : object
unpacker Unpacker which unpacks values of resulting object tree.
return object

UnpackFromAsync() public method

Deserialize object with specified Unpacker asynchronously.
/// is null. /// /// Failed to deserialize object. /// /// Failed to deserialize object due to invalid stream. /// /// Failed to deserialize object due to invalid stream. /// /// The type of deserializing is not serializable even if it can be serialized. ///
public UnpackFromAsync ( Unpacker unpacker, CancellationToken cancellationToken ) : Task
unpacker Unpacker which unpacks values of resulting object tree.
cancellationToken System.Threading.CancellationToken The token to monitor for cancellation requests. The default value is .
return Task

UnpackSingleObject() public method

Deserialize a single object from the array of Byte which contains a serialized object.

This method assumes that buffer contains single serialized object dedicatedly, so this method does not return any information related to actual consumed bytes.

This method is a counter part of PackSingleObject.

public UnpackSingleObject ( byte buffer ) : object
buffer byte An array of serialized value to be stored.
return object

UnpackSingleObjectAsync() public method

Deserialize a single object from the array of Byte which contains a serialized object.

This method assumes that buffer contains single serialized object dedicatedly, so this method does not return any information related to actual consumed bytes.

This method is a counter part of PackSingleObjectAsync.

/// is null. /// /// Failed to deserialize object. /// /// Failed to deserialize object due to invalid stream. /// /// Failed to deserialize object due to invalid stream. /// /// The type of deserializing is not serializable even if it can be serialized. ///
public UnpackSingleObjectAsync ( byte buffer, CancellationToken cancellationToken ) : Task
buffer byte An array of serialized value to be stored.
cancellationToken System.Threading.CancellationToken The token to monitor for cancellation requests. The default value is .
return Task

UnpackTo() public method

Deserialize collection items with specified Unpacker and stores them to collection.
public UnpackTo ( Unpacker unpacker, object collection ) : void
unpacker Unpacker which unpacks values of resulting object tree.
collection object Collection that the items to be stored.
return void

UnpackToAsync() public method

Deserialize collection items with specified Unpacker and stores them to collection asynchronously.
/// is null. /// Or is null. /// /// is not compatible for this serializer. /// /// Failed to deserialize object. /// /// Failed to deserialize object due to invalid stream. /// /// Failed to deserialize object due to invalid stream. /// /// The type of deserializing is not mutable collection. ///
public UnpackToAsync ( Unpacker unpacker, object collection, CancellationToken cancellationToken ) : Task
unpacker Unpacker which unpacks values of resulting object tree.
collection object Collection that the items to be stored.
cancellationToken System.Threading.CancellationToken The token to monitor for cancellation requests. The default value is .
return Task