Class SerializationHelper
Miscellaneous serialization utilities.
Inherited Members
Namespace: Tangosol.Util
Assembly: Coherence.dll
Syntax
public class SerializationHelper
Fields
DECO_VALUE
Decoration: The original value (before being decorated).
Declaration
public static readonly int DECO_VALUE
Field Value
Type | Description |
---|---|
int |
Methods
ConvertUTF(byte[], int, int)
Convert binary UTF-8 encode data to a String. This method is a helper to allow various I/O implementations to share a single, efficient implementation.
Declaration
public static string ConvertUTF(byte[] ab, int of, int cb)
Parameters
Type | Name | Description |
---|---|---|
byte[] | ab | an array of bytes containing UTF-8 encoded characters |
int | of | the offset into the array of the UTF-8 data to decode |
int | cb | the binary length in the array of the UTF-8 data to decode |
Returns
Type | Description |
---|---|
string |
Exceptions
Type | Condition |
---|---|
IOException | throws ArgumentException if the UTF data is corrupt |
DecorateBinary(Binary, int)
Decorate the specified Binary with the specified integer decoration.
Declaration
public static Binary DecorateBinary(Binary binValue, int decoration)
Parameters
Type | Name | Description |
---|---|---|
Binary | binValue | The Binary to be decorated. |
int | decoration | The integer decoration. |
Returns
Type | Description |
---|---|
Binary | The decorated (with integer decoration) Binary object. |
ExtractIntDecoration(Binary)
Extract a decoration value from the specified Binary that contains an integer decoration.
Declaration
public static int ExtractIntDecoration(Binary bin)
Parameters
Type | Name | Description |
---|---|---|
Binary | bin | The Binary object. |
Returns
Type | Description |
---|---|
int | The integer decoration value. |
Exceptions
Type | Condition |
---|---|
ArgumentException | If the Binary does not have an int decoration. |
FromBinary(Binary, ISerializer)
Deserialize an object from its Binary form.
Declaration
public static object FromBinary(Binary bin, ISerializer serializer)
Parameters
Type | Name | Description |
---|---|---|
Binary | bin | Binary representation of an object. |
ISerializer | serializer | ISerializer to use. |
Returns
Type | Description |
---|---|
object | Deserialized object. |
Exceptions
Type | Condition |
---|---|
IOException | If an I/O error occurs. |
IsIntDecorated(Binary)
Check whether or not the specified Binary has an integer decoration.
Declaration
public static bool IsIntDecorated(Binary bin)
Parameters
Type | Name | Description |
---|---|---|
Binary | bin | The Binary object. |
Returns
Type | Description |
---|---|
bool | True if the Binary contains (starts with) an integer decoration; false otherwise. |
RemoveIntDecoration(Binary)
Remove the integer decoration from the specified Binary.
Declaration
public static Binary RemoveIntDecoration(Binary bin)
Parameters
Type | Name | Description |
---|---|---|
Binary | bin | The Binary object. |
Returns
Type | Description |
---|---|
Binary | The undecorated Binary value. |
ToBinary(object, ISerializer)
Serialize an object into its Binary form.
Declaration
public static Binary ToBinary(object o, ISerializer serializer)
Parameters
Type | Name | Description |
---|---|---|
object | o | Object to serialize. |
ISerializer | serializer | ISerializer to use. |
Returns
Type | Description |
---|---|
Binary | Serialized Binary representation of the specified object. |
Exceptions
Type | Condition |
---|---|
IOException | If an I/O error occurs. |