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

Defines methods for serializing and deserializing objects to and from binary data. More...

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

Public Member Functions

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 a stream.
 
Deserialize< T > (System.IO.Stream stream)
 Deserializes an object of the specified type from a stream.
 
Deserialize< T > (byte[] data)
 Deserializes an object of the specified type from a byte array.
 
bool TryParse< T > (System.IO.Stream stream, out T tValue)
 Tries to parse and deserialize an object of the specified type from a stream.
 
bool TryParse< T > (byte[] data, out T tValue)
 Tries to parse and deserialize an object of the specified type from a byte array.
 

Detailed Description

Defines methods for serializing and deserializing objects to and from binary data.

Member Function Documentation

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

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

Deserializes an object of the specified type from a byte array.

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

Implemented in XmobiTea.Binary.MessagePack.BinaryConverter, and XmobiTea.Binary.SimplePack.BinaryConverter.

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

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

Deserializes an object of the specified type from a stream.

Template Parameters
TThe type of the object to deserialize.
Parameters
streamThe stream from which the object is deserialized.
Returns
The deserialized object of type T .

Implemented in XmobiTea.Binary.MessagePack.BinaryConverter.

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

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

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

Template Parameters
TThe type of the object to serialize.
Parameters
streamThe stream to which the binary data is written.
tObjThe object to serialize.

Implemented in XmobiTea.Binary.MessagePack.BinaryConverter.

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

byte[] XmobiTea.Binary.IBinaryConverter.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 representing the serialized object.

Implemented in XmobiTea.Binary.MessagePack.BinaryConverter, and XmobiTea.Binary.SimplePack.BinaryConverter.

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

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

Tries to parse and deserialize an object of the specified type from a byte array.

Template Parameters
TThe type of the object to deserialize.
Parameters
dataThe byte array containing the serialized object.
tValueWhen this method returns, contains the deserialized object of type T if the parsing succeeded, or the default value of T if the parsing failed.
Returns
true if the parsing succeeded; otherwise, false.

Implemented in XmobiTea.Binary.MessagePack.BinaryConverter, and XmobiTea.Binary.SimplePack.BinaryConverter.

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

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

Tries to parse and deserialize an object of the specified type from a stream.

Template Parameters
TThe type of the object to deserialize.
Parameters
streamThe stream from which the object is deserialized.
tValueWhen this method returns, contains the deserialized object of type T if the parsing succeeded, or the default value of T if the parsing failed.
Returns
true if the parsing succeeded; otherwise, false.

Implemented in XmobiTea.Binary.MessagePack.BinaryConverter.


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