x4Trace Documentation v1.0
Loading...
Searching...
No Matches
Tools.Serialize.ObjectSerializer Class Reference

Serializes the object. Copies the primitive types of members. More...

Public Member Functions

 ObjectSerializer (byte[] buffer)
 Constructor.
 
 ObjectSerializer (int size)
 Constructor.
 
void Reset ()
 Resters the seek of buffer.
 
 ObjectSerializer (string[] array)
 Constructor.
 
void SetSeek (int seek)
 Sets the seek of serialization.
 
void Write (int num)
 Writes number to buffer.
 
int ReadInt ()
 Reads int from buffer.
 
void Write (long num)
 Writes lont to buffer.
 
long ReadLong ()
 Reads long from buffer.
 
void Write (DateTime dt)
 Writes datetime to buffer.
 
DateTime ReadDateTime ()
 Reads datetime from buffer.
 
void Write (string str)
 Writes string to buffer.
 
string ReadString ()
 Reads string from buffer.
 
void Write (decimal d)
 Writes decimal value to buffer.
 
decimal ReadDecimal ()
 Reads decimal value from buffer.
 
void WriteString (string[] str)
 Writes string array to buffer.
 
string[] ReadStringArr ()
 Reads string array from buffer.
 
void WriteObject (object[] obj)
 Writes object array to buffer.
 
void WriteObject (object obj)
 Writes object to buffer.
 
object[] ReadObjectArray ()
 Reads object array from buffer.
 
object ReadObject ()
 Reads object from buffer.
 
void WriteType (Type t)
 Writes thy to buffer.
 
Type ReadType ()
 Reads type from buffer.
 
void Write (bool b)
 Writes bool to buffer.
 
bool ReadBool ()
 Reads bool from buffer.
 
void Write (byte b)
 Writes byte to buffer.
 
byte ReadByte ()
 Reads byte from buffer.
 
byte[] GetBuffer ()
 Returns the buffer of serializetion.
 

Static Public Member Functions

static int ToByte (byte[] array, DateTime dt, int startIndex)
 Writes datetime to byte array.
 
static DateTime ToDateTime (byte[] array, int startIndex)
 Converts a section of array to datetime.
 
static int ToByte (byte[] array, int num, int startIndex)
 Writes int to byte array.
 
static int ToInt (byte[] array, int startIndex)
 Converts a section of array to int.
 
static int ToByte (byte[] array, double num, int startIndex)
 Writes double to byte array.
 
static double ToDouble (byte[] array, int startIndex)
 Converts a section of array to double.
 
static int ToByte (byte[] array, long num, int startIndex)
 Writes long to byte array.
 
static long ToLong (byte[] array, int startIndex)
 Converts a section of array to long.
 
static int ToByte (byte[] array, string str, int startIndex)
 Writes string to byte array.
 
static int ToString (byte[] array, out string str, int startIndex)
 Reads a section of array to string.
 

Properties

int Seek [get]
 The seek value.
 

Private Attributes

byte[] buffer
 Buffer of serializetion.
 
int seek = 0
 Seek value.
 

Static Private Attributes

static int tInt = 1
 Int type.
 
static int tLong = 2
 Long type.
 
static int tDecimal = 3
 Decimal type.
 
static int tDateTime = 4
 Datetime type.
 
static int tString = 5
 String type.
 
static int tSystemBoolean = 6
 Bool type.
 
static int tDateTimeOffset = 7
 Offset of date time.
 
static int tSystemDBNull = 8
 System.DBNull type.
 
static int tSystemByte = 9
 Byte type.
 

Detailed Description

Serializes the object. Copies the primitive types of members.

Constructor & Destructor Documentation

◆ ObjectSerializer() [1/3]

Tools.Serialize.ObjectSerializer.ObjectSerializer ( byte[] buffer)

Constructor.

Parameters
bufferBuffer of serializetion/deserializetion.

◆ ObjectSerializer() [2/3]

Tools.Serialize.ObjectSerializer.ObjectSerializer ( int size)

Constructor.

Parameters
size

◆ ObjectSerializer() [3/3]

Tools.Serialize.ObjectSerializer.ObjectSerializer ( string[] array)

Constructor.

Parameters
arrayArray of string of values.

Member Function Documentation

◆ GetBuffer()

byte[] Tools.Serialize.ObjectSerializer.GetBuffer ( )

Returns the buffer of serializetion.

Returns
The buffer.

◆ ReadBool()

bool Tools.Serialize.ObjectSerializer.ReadBool ( )

Reads bool from buffer.

Returns
Readed value.

◆ ReadByte()

byte Tools.Serialize.ObjectSerializer.ReadByte ( )

Reads byte from buffer.

Returns
The readed byte.

◆ ReadDateTime()

DateTime Tools.Serialize.ObjectSerializer.ReadDateTime ( )

Reads datetime from buffer.

Returns
Datetime value.

◆ ReadDecimal()

decimal Tools.Serialize.ObjectSerializer.ReadDecimal ( )

Reads decimal value from buffer.

Returns
Decimal value.

◆ ReadInt()

int Tools.Serialize.ObjectSerializer.ReadInt ( )

Reads int from buffer.

Returns
Int value.

◆ ReadLong()

long Tools.Serialize.ObjectSerializer.ReadLong ( )

Reads long from buffer.

Returns
Long value.

◆ ReadObject()

object Tools.Serialize.ObjectSerializer.ReadObject ( )

Reads object from buffer.

Returns
The readed object.

◆ ReadObjectArray()

object[] Tools.Serialize.ObjectSerializer.ReadObjectArray ( )

Reads object array from buffer.

Returns
Array of objects.

◆ ReadString()

string Tools.Serialize.ObjectSerializer.ReadString ( )

Reads string from buffer.

Returns
String value.

◆ ReadStringArr()

string[] Tools.Serialize.ObjectSerializer.ReadStringArr ( )

Reads string array from buffer.

Returns
Array of stirng.

◆ ReadType()

Type Tools.Serialize.ObjectSerializer.ReadType ( )

Reads type from buffer.

Returns
The readed type.

◆ SetSeek()

void Tools.Serialize.ObjectSerializer.SetSeek ( int seek)

Sets the seek of serialization.

Parameters
seekValue of seek.

◆ ToByte() [1/5]

static int Tools.Serialize.ObjectSerializer.ToByte ( byte[] array,
DateTime dt,
int startIndex )
static

Writes datetime to byte array.

Parameters
arrayArray of destination.
dtDate time to write.
startIndexStartindex of array.
Returns
Length of write.

◆ ToByte() [2/5]

static int Tools.Serialize.ObjectSerializer.ToByte ( byte[] array,
double num,
int startIndex )
static

Writes double to byte array.

Parameters
arrayArray of destination.
numNumber to write.
startIndexStartindex of array.
Returns
Length of write.

◆ ToByte() [3/5]

static int Tools.Serialize.ObjectSerializer.ToByte ( byte[] array,
int num,
int startIndex )
static

Writes int to byte array.

Parameters
arrayArray of destination.
numNumber to write.
startIndexStartindex of array.
Returns
Length of write.

◆ ToByte() [4/5]

static int Tools.Serialize.ObjectSerializer.ToByte ( byte[] array,
long num,
int startIndex )
static

Writes long to byte array.

Parameters
arrayArray of destination.
numNumber to write.
startIndexStartindex of array.
Returns
Length of write.

◆ ToByte() [5/5]

static int Tools.Serialize.ObjectSerializer.ToByte ( byte[] array,
string str,
int startIndex )
static

Writes string to byte array.

Parameters
arrayArray of destination.
strString to write.
startIndex
Returns
Length of write.

◆ ToDateTime()

static DateTime Tools.Serialize.ObjectSerializer.ToDateTime ( byte[] array,
int startIndex )
static

Converts a section of array to datetime.

Parameters
arrayArray of data.
startIndexStartindex of datetime.
Returns
The date time.

◆ ToDouble()

static double Tools.Serialize.ObjectSerializer.ToDouble ( byte[] array,
int startIndex )
static

Converts a section of array to double.

Parameters
arrayArray of data.
startIndexStartindex of double.
Returns
Double value.

◆ ToInt()

static int Tools.Serialize.ObjectSerializer.ToInt ( byte[] array,
int startIndex )
static

Converts a section of array to int.

Parameters
arrayArray of data.
startIndexStartindex of int.
Returns
The int value.

◆ ToLong()

static long Tools.Serialize.ObjectSerializer.ToLong ( byte[] array,
int startIndex )
static

Converts a section of array to long.

Parameters
arrayArray of data.
startIndexStartindex of long.
Returns
The long value.

◆ ToString()

static int Tools.Serialize.ObjectSerializer.ToString ( byte[] array,
out string str,
int startIndex )
static

Reads a section of array to string.

Parameters
arrayArray of data.
strString to read.
startIndexStart index of read.
Returns

◆ Write() [1/7]

void Tools.Serialize.ObjectSerializer.Write ( bool b)

Writes bool to buffer.

Parameters
bBool to write.

◆ Write() [2/7]

void Tools.Serialize.ObjectSerializer.Write ( byte b)

Writes byte to buffer.

Parameters
bByte to write.

◆ Write() [3/7]

void Tools.Serialize.ObjectSerializer.Write ( DateTime dt)

Writes datetime to buffer.

Parameters
dtDate time to write.

◆ Write() [4/7]

void Tools.Serialize.ObjectSerializer.Write ( decimal d)

Writes decimal value to buffer.

Parameters
dValue to write.

◆ Write() [5/7]

void Tools.Serialize.ObjectSerializer.Write ( int num)

Writes number to buffer.

Parameters
numNumber to write.

◆ Write() [6/7]

void Tools.Serialize.ObjectSerializer.Write ( long num)

Writes lont to buffer.

Parameters
numNumber to write.

◆ Write() [7/7]

void Tools.Serialize.ObjectSerializer.Write ( string str)

Writes string to buffer.

Parameters
strString to write.

◆ WriteObject() [1/2]

void Tools.Serialize.ObjectSerializer.WriteObject ( object obj)

Writes object to buffer.

Parameters
objObject to write.

◆ WriteObject() [2/2]

void Tools.Serialize.ObjectSerializer.WriteObject ( object[] obj)

Writes object array to buffer.

Parameters
objObject array to write.

◆ WriteString()

void Tools.Serialize.ObjectSerializer.WriteString ( string[] str)

Writes string array to buffer.

Parameters
strArray of string.

◆ WriteType()

void Tools.Serialize.ObjectSerializer.WriteType ( Type t)

Writes thy to buffer.

Parameters
tType to write.

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