ProtonNet Server 1.0
An Open Solution for all your socket or web api needs.
Loading...
Searching...
No Matches
XmobiTea.Binary.MessagePack.BinaryConverter Class Reference

Provides methods for serializing and deserializing objects using MessagePack. More...

Inheritance diagram for XmobiTea.Binary.MessagePack.BinaryConverter:
XmobiTea.Binary.IBinaryConverter

Public Member Functions

 BinaryConverter ()
 Initializes a new instance of the BinaryConverter class.
 
byte[] Serialize< T > (T tObj)
 Serializes the specified object to a byte array.
 
void Serialize< T > (System.IO.Stream stream, T tObj)
 Serializes the specified object and writes the binary data to the provided stream.
 
Deserialize< T > (System.IO.Stream stream)
 Deserializes data from the provided stream into an object of type T .
 
Deserialize< T > (byte[] data)
 Deserializes the specified byte array into an object of type T .
 
bool TryParse< T > (System.IO.Stream stream, out T tValue)
 Tries to deserialize data from the provided stream into an object of type T .
 
bool TryParse< T > (byte[] data, out T tValue)
 Tries to deserialize the specified byte array into an object of type T .
 
- Public Member Functions inherited from XmobiTea.Binary.IBinaryConverter

Detailed Description

Provides methods for serializing and deserializing objects using MessagePack.

Member Function Documentation

◆ Deserialize< T >() [1/2]

T XmobiTea.Binary.MessagePack.BinaryConverter.Deserialize< T > ( byte[] data)

Deserializes the specified byte array into an object of type T .

Template Parameters
TThe type of the object to deserialize.
Parameters
dataThe byte array containing the binary data.
Returns
The deserialized object.

Implements XmobiTea.Binary.IBinaryConverter.

◆ Deserialize< T >() [2/2]

T XmobiTea.Binary.MessagePack.BinaryConverter.Deserialize< T > ( System.IO.Stream stream)

Deserializes data from the provided stream into an object of type T .

Template Parameters
TThe type of the object to deserialize.
Parameters
streamThe stream containing the binary data.
Returns
The deserialized object.

Implements XmobiTea.Binary.IBinaryConverter.

◆ Serialize< T >() [1/2]

void XmobiTea.Binary.MessagePack.BinaryConverter.Serialize< T > ( System.IO.Stream stream,
T tObj )

Serializes the specified object and writes the binary data to the provided stream.

Template Parameters
TThe type of the object to serialize.
Parameters
streamThe stream to write the serialized data to.
tObjThe object to serialize.

Implements XmobiTea.Binary.IBinaryConverter.

◆ Serialize< T >() [2/2]

byte[] XmobiTea.Binary.MessagePack.BinaryConverter.Serialize< T > ( T tObj)

Serializes the specified object to a byte array.

Template Parameters
TThe type of the object to serialize.
Parameters
tObjThe object to serialize.
Returns
A byte array containing the serialized data.

Implements XmobiTea.Binary.IBinaryConverter.

◆ TryParse< T >() [1/2]

bool XmobiTea.Binary.MessagePack.BinaryConverter.TryParse< T > ( byte[] data,
out T tValue )

Tries to deserialize the specified byte array into an object of type T .

Template Parameters
TThe type of the object to deserialize.
Parameters
dataThe byte array containing the binary data.
tValueWhen this method returns, contains the deserialized object.
Returns
true if the deserialization succeeded; otherwise, false.

Implements XmobiTea.Binary.IBinaryConverter.

◆ TryParse< T >() [2/2]

bool XmobiTea.Binary.MessagePack.BinaryConverter.TryParse< T > ( System.IO.Stream stream,
out T tValue )

Tries to deserialize data from the provided stream into an object of type T .

Template Parameters
TThe type of the object to deserialize.
Parameters
streamThe stream containing the binary data.
tValueWhen this method returns, contains the deserialized object.
Returns
true if the deserialization succeeded; otherwise, false.

Implements XmobiTea.Binary.IBinaryConverter.


The documentation for this class was generated from the following file: