BinSerializer

Overview

The BinSerializer class represents Bin serializer. This class is used internally by the BinMessage class to read or write data in the Bin format.

In most cases there is no need to instantiate this class directly.

For internal use only.

Location

 

constructor  protected    (declared in Serializer)

Empty constructor.

 

constructor

 

BinSerializer()

 

Sub New()

constructor (Encoding)

 

constructor(defaultEncoding: Encoding)

 

BinSerializer(Encoding defaultEncoding)

 

Sub New(defaultEncoding As Encoding)

Parameters:

  • defaultEncoding:

constructor (Stream, Encoding)

Constructor, which allows specify stream stream BinSerializer instance should operate with.

 

constructor(stream: Stream; defaultEncoding: Encoding)

 

BinSerializer(Stream stream, Encoding defaultEncoding)

 

Sub New(stream As Stream, defaultEncoding As Encoding)

Parameters:

  • stream: specified stream object
  • defaultEncoding:

BeginReadComplex  protected

 

method BeginReadComplex(name: String; type: Type; out value: ComplexType): Boolean

 

Boolean BeginReadComplex(String name, Type type, out ComplexType value)

 

Function BeginReadComplex(name As String, type As Type, <OutAttribute> ByRef value As ComplexType) As Boolean

Parameters:

  • name:
  • type:
  • value:

BeginReadObject  protected

Call to this method to get instance of Object type or any inherited class.

 

method BeginReadObject(name: String; type: Type): Object

 

Object BeginReadObject(String name, Type type)

 

Function BeginReadObject(name As String, type As Type) As Object

Parameters:

  • name: name of the object to read.
  • type: type of the object to read

BeginWriteComplex  protected

 

method BeginWriteComplex(name: String; value: ComplexType): Boolean

 

Boolean BeginWriteComplex(String name, ComplexType value)

 

Function BeginWriteComplex(name As String, value As ComplexType) As Boolean

Parameters:

  • name:
  • value:

BeginWriteObject  protected

Call to this method to write instance of Object type or any inherited class to stream.

 

method BeginWriteObject(name: String; value: Object)

 

void BeginWriteObject(String name, Object value)

 

Sub BeginWriteObject(name As String, value As Object)

Parameters:

  • name: name of the object to write.
  • value: type of the object that will be written.

CreateComplexTypeInstance  protected    (declared in Serializer)

 

method CreateComplexTypeInstance(className: String): ComplexType

 

ComplexType CreateComplexTypeInstance(String className)

 

Function CreateComplexTypeInstance(className As String) As ComplexType

Parameters:

  • className:

EndReadComplex  protected

 

method EndReadComplex

 

void EndReadComplex()

 

Sub EndReadComplex()

EndReadObject  protected

 

method EndReadObject

 

void EndReadObject()

 

Sub EndReadObject()

EndWriteComplex  protected

 

method EndWriteComplex(value: ComplexType)

 

void EndWriteComplex(ComplexType value)

 

Sub EndWriteComplex(value As ComplexType)

Parameters:

  • value:

EndWriteObject  protected

 

method EndWriteObject

 

void EndWriteObject()

 

Sub EndWriteObject()

ObjectToStream

Static method to write Object instances to stream. As a result method returns new MemoryStream instance with serialized Object value into it.

 

class method ObjectToStream(value: Object): Stream

 

static Stream ObjectToStream(Object value)

 

Shared Function ObjectToStream(value As Object) As Stream

Parameters:

  • value: object value that should be written to stream

Read    (declared in Serializer)

The general method for reading that calls specific ReadXXX method dependently on the type of an object to read.

 

method Read(name: String; type: Type; format: StreamingFormat): Object

 

Object Read(String name, Type type, StreamingFormat format)

 

Function Read(name As String, type As Type, format As StreamingFormat) As Object

Parameters:

  • name:
  • type:
  • format:

ReadAnsiString

Reads string from stream in ANSI format. String is stored as a sequence of byte with preceding Int32 value which contains string length.

 

method ReadAnsiString: String

 

String ReadAnsiString()

 

Function ReadAnsiString() As String

ReadAnsiString (String): String

Reads ANSI string value from the specified Bin message serialized object and returns it.

 

method ReadAnsiString(name: String): String

 

String ReadAnsiString(String name)

 

Function ReadAnsiString(name As String) As String

Parameters:

  • name: name of the AnsiString object to read.

ReadArray

Reads array of type type and specified StreamingFormat. Preceding array's data, byte with value equals to 1 and Int32 value with array length.

 

method ReadArray(name: String; type: Type; format: StreamingFormat): Array

 

Array ReadArray(String name, Type type, StreamingFormat format)

 

Function ReadArray(name As String, type As Type, format As StreamingFormat) As Array

Parameters:

  • name: name of the Array object to read.
  • type: type of the array object to read
  • format: data serialization format of the Array object

ReadBinary

Returns Binary class instance. Preceding binary data, byte with value not equals to 0 and Int32 value with data length.

 

method ReadBinary(name: String): Binary

 

Binary ReadBinary(String name)

 

Function ReadBinary(name As String) As Binary

Parameters:

  • name: name of the binary object to read

ReadBoolean

Returns boolean value which is calculated as TRUE if non-zero Int32 value was read from stream, FALSE otherwise.

 

method ReadBoolean(name: String): Boolean

 

Boolean ReadBoolean(String name)

 

Function ReadBoolean(name As String) As Boolean

Parameters:

  • name: name of the boolean object to read

ReadByte

Returns byte value from stream.

 

method ReadByte: Byte

 

Byte ReadByte()

 

Function ReadByte() As Byte

ReadComplex    (declared in Serializer)

 

method ReadComplex(name: String; type: Type): ComplexType

 

ComplexType ReadComplex(String name, Type type)

 

Function ReadComplex(name As String, type As Type) As ComplexType

Parameters:

  • name:
  • type:

ReadCurrency

Returns currency value from stream.

 

method ReadCurrency(name: String): Decimal

 

Decimal ReadCurrency(String name)

 

Function ReadCurrency(name As String) As Decimal

Parameters:

  • name: name of the currency object to read

ReadCustomEnum

Returns enum value as Int32 from stream and wrap it with ICustomEnum.

 

method ReadCustomEnum(name: String): ICustomEnum

 

ICustomEnum ReadCustomEnum(String name)

 

Function ReadCustomEnum(name As String) As ICustomEnum

Parameters:


ReadDateTime

Returns DateTime value from stream.

 

method ReadDateTime(name: String): DateTime

 

DateTime ReadDateTime(String name)

 

Function ReadDateTime(name As String) As DateTime

Parameters:

  • name: name of the datetime object to read

ReadDecimal

Returns decimal value from stream.

 

method ReadDecimal(name: String): Decimal

 

Decimal ReadDecimal(String name)

 

Function ReadDecimal(name As String) As Decimal

Parameters:

  • name: name of the decimal object to read

ReadDouble

Returns double value from stream.

 

method ReadDouble(name: String): Double

 

Double ReadDouble(String name)

 

Function ReadDouble(name As String) As Double

Parameters:

  • name: name of the double object to read

ReadEnum

Returns Enum value from stream. Reads from stream Int32 value and interpretate it as Enum.

 

method ReadEnum(name: String; type: Type): Enum

 

Enum ReadEnum(String name, Type type)

 

Function ReadEnum(name As String, type As Type) As Enum

Parameters:

  • name: name of the Enum object to read
  • type: type of the Enum object to read

ReadException

 

method ReadException(type: Type; message: String; isFromServer: Boolean): Exception

 

Exception ReadException(Type type, String message, Boolean isFromServer)

 

Function ReadException(type As Type, message As String, isFromServer As Boolean) As Exception

Parameters:

  • type:
  • message:
  • isFromServer:

ReadFromCompressedStream

Writes Int32 value to stream.

 

method ReadFromCompressedStream(stream: Stream; maxSize: Int32; enforceMaxSize: Boolean)

 

void ReadFromCompressedStream(Stream stream, Int32 maxSize, Boolean enforceMaxSize)

 

Sub ReadFromCompressedStream(stream As Stream, maxSize As Int32, enforceMaxSize As Boolean)

Parameters:

  • stream: decompressed stream
  • maxSize: max value for the size of decompressed message
  • enforceMaxSize: if equals FALSE then maxDecompressedMessageSize is ignored, if TRUE then maxDecompressedMessageSize is used.

ReadFromStream (Stream)

Replaces current Stream property value with input stream.

 

method ReadFromStream(stream: Stream)

 

void ReadFromStream(Stream stream)

 

Sub ReadFromStream(stream As Stream)

Parameters:

  • stream: Stream object to read

ReadFromStream (Stream, Int32, Boolean)

Replaces current Stream property value with input stream.

 

method ReadFromStream(stream: Stream; maxMessageSize: Int32; enforceMaxSize: Boolean)

 

void ReadFromStream(Stream stream, Int32 maxMessageSize, Boolean enforceMaxSize)

 

Sub ReadFromStream(stream As Stream, maxMessageSize As Int32, enforceMaxSize As Boolean)

Parameters:

  • stream: Stream object to read
  • maxMessageSize:
  • enforceMaxSize:

ReadGenericArray

Reads array of type type and specified StreamingFormat. Preceding array's data, byte with value equals to 1 and Int32 value with array length.

 

method ReadGenericArray(name: String; type: Type; format: StreamingFormat): IList

 

IList ReadGenericArray(String name, Type type, StreamingFormat format)

 

Function ReadGenericArray(name As String, type As Type, format As StreamingFormat) As IList

Parameters:

  • name: name of the generic array object to read
  • type: type of generic array object to read
  • format: deserialization format of generic array

ReadGuid

Reads 16 bytes from Stream as a GUID.

 

method ReadGuid(name: String): Guid

 

Guid ReadGuid(String name)

 

Function ReadGuid(name As String) As Guid

Parameters:

  • name: name of GUID object to read

ReadInt16

Reads Int16 value from stream.

 

method ReadInt16: Int32

 

Int32 ReadInt16()

 

Function ReadInt16() As Int32

ReadInt32

Reads Int32 value from stream.

 

method ReadInt32: Int32

 

Int32 ReadInt32()

 

Function ReadInt32() As Int32

ReadInt32 (String): Int32

Reads Int32 value from stream.

 

method ReadInt32(name: String): Int32

 

Int32 ReadInt32(String name)

 

Function ReadInt32(name As String) As Int32

Parameters:

  • name: name of Int32 object to read

ReadInt64

Reads Int64 value from stream.

 

method ReadInt64(name: String): Int64

 

Int64 ReadInt64(String name)

 

Function ReadInt64(name As String) As Int64

Parameters:

  • name: name of Int64 object to read

ReadObject    (declared in Serializer)

 

method ReadObject(name: String; type: Type): Object

 

Object ReadObject(String name, Type type)

 

Function ReadObject(name As String, type As Type) As Object

Parameters:

  • name:
  • type:

ReadObjectData    (declared in Serializer)

 

method ReadObjectData(value: Object)

 

void ReadObjectData(Object value)

 

Sub ReadObjectData(value As Object)

Parameters:

  • value:

ReadUtf8String

Reads string from stream in UTF8 format. String is stored as a sequence of byte with preceding Int32 value which contains string length.

 

method ReadUtf8String: String

 

String ReadUtf8String()

 

Function ReadUtf8String() As String

ReadUtf8String (String): String

Reads string from stream in UTF8 format. String is stored as a sequence of byte with preceding Int32 value which contains string length.

 

method ReadUtf8String(name: String): String

 

String ReadUtf8String(String name)

 

Function ReadUtf8String(name As String) As String

Parameters:

  • name: name of Utf8String object to read

ReadVariant

Reads object from stream which can be any numerical type, currency, DateTime, Array, binary data, string, boolean or GUID. Data for object is preceded with Int32 type code value which is interpreted as a Variant Code or equals to 0x2011 when there is simple binary data.

 

method ReadVariant(name: String): Object

 

Object ReadVariant(String name)

 

Function ReadVariant(name As String) As Object

Parameters:

  • name: name of Variant object to read

ReadWideString

Reads string from stream in UTF32 format. String is stored as a sequence of byte with preceding Int32 value which contains string length in characters (so it occupies twice as preceding length value, bytes).

 

method ReadWideString: String

 

String ReadWideString()

 

Function ReadWideString() As String

ReadWideString (String): String

Reads string from stream in UTF32 format. String is stored as a sequence of byte with preceding Int32 value which contains string length in characters (so it occupies twice as preceding length value, bytes).

 

method ReadWideString(name: String): String

 

String ReadWideString(String name)

 

Function ReadWideString(name As String) As String

Parameters:

  • name: name of WideString object to read

ReadXml

Reads string in UTF8 encoding and tries to parse it as XML.

 

method ReadXml(name: String): XmlNode

 

XmlNode ReadXml(String name)

 

Function ReadXml(name As String) As XmlNode

Parameters:

  • name: name of Xml object to read

RecordStrictOrder    (declared in Serializer)

Order of complex types fields in which they will be serialized/deserialized. If set to true the order or fields remains the same as in native type. If false, fields will be ordered alphabetically. FALSE by default.

 

property RecordStrictOrder: Boolean read;

 

Boolean RecordStrictOrder { get; }

 

ReadOnly Property RecordStrictOrder() As Boolean

Stream

Stream object to write/read objects to.

 

property Stream: Stream read;

 

Stream Stream { get; }

 

ReadOnly Property Stream() As Stream

StreamToObject

Static method to readObject instances from stream. As a result method returns Object instance which is a result of deserealizing from input aStream.

 

class method StreamToObject(stream: Stream): Object

 

static Object StreamToObject(Stream stream)

 

Shared Function StreamToObject(stream As Stream) As Object

Parameters:

  • stream: stream object to read from

TryReadUtf8String

Equivalent to ReadUtf8String

 

method TryReadUtf8String: String

 

String TryReadUtf8String()

 

Function TryReadUtf8String() As String

TypeFactory    (declared in Serializer)

When doing custom reading/writing of values, the type factory can be used to provide custom serializable types.

 

property TypeFactory: ITypeFactory read write;

 

ITypeFactory TypeFactory { get; set; }

 

Property TypeFactory() As ITypeFactory

Write (String, Object, StreamingFormat)    (declared in Serializer)

 

method Write(name: String; value: Object; format: StreamingFormat)

 

void Write(String name, Object value, StreamingFormat format)

 

Sub Write(name As String, value As Object, format As StreamingFormat)

Parameters:

  • name:
  • value:
  • format:

Write (String, Object, Type, StreamingFormat)    (declared in Serializer)

The general method for writing that calls specific WriteXXX method dependently on the type of an object to write.

 

method Write(name: String; value: Object; type: Type; format: StreamingFormat)

 

void Write(String name, Object value, Type type, StreamingFormat format)

 

Sub Write(name As String, value As Object, type As Type, format As StreamingFormat)

Parameters:

  • name:
  • value:
  • type:
  • format:

WriteAnsiString (String, String)

 

method WriteAnsiString(name: String; value: String)

 

void WriteAnsiString(String name, String value)

 

Sub WriteAnsiString(name As String, value As String)

Parameters:

  • name:
  • value:

WriteAnsiString (String)

 

method WriteAnsiString(value: String)

 

void WriteAnsiString(String value)

 

Sub WriteAnsiString(value As String)

Parameters:

  • value:

WriteArray

If value not nil then writes byte with value equals to 1, Int32 value with array length, and array data. If value is nil then simply writes 0 to stream.

 

method WriteArray(name: String; value: Array; format: StreamingFormat)

 

void WriteArray(String name, Array value, StreamingFormat format)

 

Sub WriteArray(name As String, value As Array, format As StreamingFormat)

Parameters:

  • name: name of Array object to write
  • value: value of the Array object to write
  • format: serialization format of the Array object

WriteBinary

If value not nil then writes byte with value equals to 1, Int32 value with stream length, and copy data from input stream to Stream property. If value is nil then simply writes 0 to stream.

 

method WriteBinary(name: String; value: Stream)

 

void WriteBinary(String name, Stream value)

 

Sub WriteBinary(name As String, value As Stream)

Parameters:

  • name: name of the Binary object to write
  • value: value of the Binary object to write

WriteBoolean

Writes Int32 value equals to 1 if value is TRUE otherwise - 0.

 

method WriteBoolean(name: String; value: Boolean)

 

void WriteBoolean(String name, Boolean value)

 

Sub WriteBoolean(name As String, value As Boolean)

Parameters:

  • name: name of the Boolean object to write
  • value: value of the Boolean object to write

WriteByte

Writes byte value to stream.

 

method WriteByte(value: Byte)

 

void WriteByte(Byte value)

 

Sub WriteByte(value As Byte)

Parameters:

  • value: Byte value to write

WriteComplex    (declared in Serializer)

 

method WriteComplex(name: String; value: ComplexType)

 

void WriteComplex(String name, ComplexType value)

 

Sub WriteComplex(name As String, value As ComplexType)

Parameters:

  • name:
  • value:

WriteCurrency

Writes decimal value to stream.

 

method WriteCurrency(name: String; value: Decimal)

 

void WriteCurrency(String name, Decimal value)

 

Sub WriteCurrency(name As String, value As Decimal)

Parameters:

  • name: name of the Currency object to write
  • value: value of the Currency object to write

WriteCustomEnum

Writes enum value wraped to ICustomEnum interface to stream.

 

method WriteCustomEnum(name: String; value: ICustomEnum)

 

void WriteCustomEnum(String name, ICustomEnum value)

 

Sub WriteCustomEnum(name As String, value As ICustomEnum)

Parameters:


WriteDateTime

Writes DateTime value to stream.

 

method WriteDateTime(name: String; value: DateTime)

 

void WriteDateTime(String name, DateTime value)

 

Sub WriteDateTime(name As String, value As DateTime)

Parameters:

  • name: name of the DateTime object to write
  • value: value of the DateTime object to write

WriteDecimal

Writes decimal value to stream.

 

method WriteDecimal(name: String; value: Decimal)

 

void WriteDecimal(String name, Decimal value)

 

Sub WriteDecimal(name As String, value As Decimal)

Parameters:

  • name: name of the Decimal object to write
  • value: value of the Decimal object to write

WriteDouble

Writes decimal value to stream.

 

method WriteDouble(name: String; value: Double)

 

void WriteDouble(String name, Double value)

 

Sub WriteDouble(name As String, value As Double)

Parameters:

  • name: name of the Double object to write
  • value: value of the Double object to write

WriteEnum

Writes enum value to stream.

 

method WriteEnum(name: String; value: Enum)

 

void WriteEnum(String name, Enum value)

 

Sub WriteEnum(name As String, value As Enum)

Parameters:

  • name: name of the Enum object to write
  • value: value of the Enum object to write

WriteGenericArray

If value not nil then writes byte with value equals to 1, Int32 value with array length, and array data. If value is nil then simply writes 0 to stream.

 

method WriteGenericArray(name: String; value: IList; format: StreamingFormat)

 

void WriteGenericArray(String name, IList value, StreamingFormat format)

 

Sub WriteGenericArray(name As String, value As IList, format As StreamingFormat)

Parameters:

  • name: name of the generic array object to write
  • value: value of the generic array object to write
  • format: data serialization format of the generic array object

WriteGuid

Writes GUID to stream.

 

method WriteGuid(name: String; value: Guid)

 

void WriteGuid(String name, Guid value)

 

Sub WriteGuid(name As String, value As Guid)

Parameters:

  • name: name of the Guid object to write
  • value: value of the Guid object to write

WriteInt16

Writes Int16 value to stream.

 

method WriteInt16(value: Int32)

 

void WriteInt16(Int32 value)

 

Sub WriteInt16(value As Int32)

Parameters:

  • value: Int16 value to write

WriteInt32 (String, Int32)

Writes Int32 value to stream.

 

method WriteInt32(name: String; value: Int32)

 

void WriteInt32(String name, Int32 value)

 

Sub WriteInt32(name As String, value As Int32)

Parameters:

  • name:
  • value: value of the Int32 object to write

WriteInt32 (Int32)

 

method WriteInt32(value: Int32)

 

void WriteInt32(Int32 value)

 

Sub WriteInt32(value As Int32)

Parameters:

  • value:

WriteInt64

Writes Int64 value to stream.

 

method WriteInt64(name: String; value: Int64)

 

void WriteInt64(String name, Int64 value)

 

Sub WriteInt64(name As String, value As Int64)

Parameters:

  • name: name of the Int64 object to write
  • value: value of the Int64 object to write

WriteObject    (declared in Serializer)

This method is a wrapper for Write method. It defines a type and streaming format of passed object.

 

method WriteObject(name: String; value: Object)

 

void WriteObject(String name, Object value)

 

Sub WriteObject(name As String, value As Object)

Parameters:

  • name:
  • value:

WriteObjectData    (declared in Serializer)

 

method WriteObjectData(value: Object)

 

void WriteObjectData(Object value)

 

Sub WriteObjectData(value As Object)

Parameters:

  • value:

WriteToCompressedStream

Compress Stream property value with Deflater class and writes it to specified in stream parameter stream.

 

method WriteToCompressedStream(stream: Stream)

 

void WriteToCompressedStream(Stream stream)

 

Sub WriteToCompressedStream(stream As Stream)

Parameters:

  • stream: stream object to write

WriteToStream

Writes ALL content of stream property to specified stream.

 

method WriteToStream(stream: Stream)

 

void WriteToStream(Stream stream)

 

Sub WriteToStream(stream As Stream)

Parameters:

  • stream: Stream object to write

WriteUtf8String (String, String)

 

method WriteUtf8String(name: String; value: String)

 

void WriteUtf8String(String name, String value)

 

Sub WriteUtf8String(name As String, value As String)

Parameters:

  • name:
  • value:

WriteUtf8String (String)

 

method WriteUtf8String(value: String)

 

void WriteUtf8String(String value)

 

Sub WriteUtf8String(value As String)

Parameters:

  • value:

WriteVariant

Writes to stream any object of any type.

 

method WriteVariant(name: String; value: Object)

 

void WriteVariant(String name, Object value)

 

Sub WriteVariant(name As String, value As Object)

Parameters:

  • name: name of the Variant object to write
  • value: value of the Variant object to write

WriteWideString (String, String)

 

method WriteWideString(name: String; value: String)

 

void WriteWideString(String name, String value)

 

Sub WriteWideString(name As String, value As String)

Parameters:

  • name:
  • value:

WriteWideString (String)

 

method WriteWideString(value: String)

 

void WriteWideString(String value)

 

Sub WriteWideString(value As String)

Parameters:

  • value:

WriteXml

Write XmlNode object to stream.

 

method WriteXml(name: String; value: XmlNode)

 

void WriteXml(String name, XmlNode value)

 

Sub WriteXml(name As String, value As XmlNode)

Parameters:

  • name: name of the XmlNode object to write
  • value: value of the XmlNode object to write

 

RecordStrictOrder    (declared in Serializer)

Order of complex types fields in which they will be serialized/deserialized. If set to true the order or fields remains the same as in native type. If false, fields will be ordered alphabetically. FALSE by default.

 

property RecordStrictOrder: Boolean read;

 

Boolean RecordStrictOrder { get; }

 

ReadOnly Property RecordStrictOrder() As Boolean

Stream

Stream object to write/read objects to.

 

property Stream: Stream read;

 

Stream Stream { get; }

 

ReadOnly Property Stream() As Stream

TypeFactory    (declared in Serializer)

When doing custom reading/writing of values, the type factory can be used to provide custom serializable types.

 

property TypeFactory: ITypeFactory read write;

 

ITypeFactory TypeFactory { get; set; }

 

Property TypeFactory() As ITypeFactory

 

ObjectToStream

Static method to write Object instances to stream. As a result method returns new MemoryStream instance with serialized Object value into it.

 

class method ObjectToStream(value: Object): Stream

 

static Stream ObjectToStream(Object value)

 

Shared Function ObjectToStream(value As Object) As Stream

Parameters:

  • value: object value that should be written to stream

StreamToObject

Static method to readObject instances from stream. As a result method returns Object instance which is a result of deserealizing from input aStream.

 

class method StreamToObject(stream: Stream): Object

 

static Object StreamToObject(Stream stream)

 

Shared Function StreamToObject(stream As Stream) As Object

Parameters:

  • stream: stream object to read from

 

constructor  protected    (declared in Serializer)

Empty constructor.

 

constructor

 

BinSerializer()

 

Sub New()

constructor (Encoding)

 

constructor(defaultEncoding: Encoding)

 

BinSerializer(Encoding defaultEncoding)

 

Sub New(defaultEncoding As Encoding)

Parameters:

  • defaultEncoding:

constructor (Stream, Encoding)

Constructor, which allows specify stream stream BinSerializer instance should operate with.

 

constructor(stream: Stream; defaultEncoding: Encoding)

 

BinSerializer(Stream stream, Encoding defaultEncoding)

 

Sub New(stream As Stream, defaultEncoding As Encoding)

Parameters:

  • stream: specified stream object
  • defaultEncoding:

BeginReadComplex  protected

 

method BeginReadComplex(name: String; type: Type; out value: ComplexType): Boolean

 

Boolean BeginReadComplex(String name, Type type, out ComplexType value)

 

Function BeginReadComplex(name As String, type As Type, <OutAttribute> ByRef value As ComplexType) As Boolean

Parameters:

  • name:
  • type:
  • value:

BeginReadObject  protected

Call to this method to get instance of Object type or any inherited class.

 

method BeginReadObject(name: String; type: Type): Object

 

Object BeginReadObject(String name, Type type)

 

Function BeginReadObject(name As String, type As Type) As Object

Parameters:

  • name: name of the object to read.
  • type: type of the object to read

BeginWriteComplex  protected

 

method BeginWriteComplex(name: String; value: ComplexType): Boolean

 

Boolean BeginWriteComplex(String name, ComplexType value)

 

Function BeginWriteComplex(name As String, value As ComplexType) As Boolean

Parameters:

  • name:
  • value:

BeginWriteObject  protected

Call to this method to write instance of Object type or any inherited class to stream.

 

method BeginWriteObject(name: String; value: Object)

 

void BeginWriteObject(String name, Object value)

 

Sub BeginWriteObject(name As String, value As Object)

Parameters:

  • name: name of the object to write.
  • value: type of the object that will be written.

CreateComplexTypeInstance  protected    (declared in Serializer)

 

method CreateComplexTypeInstance(className: String): ComplexType

 

ComplexType CreateComplexTypeInstance(String className)

 

Function CreateComplexTypeInstance(className As String) As ComplexType

Parameters:

  • className:

EndReadComplex  protected

 

method EndReadComplex

 

void EndReadComplex()

 

Sub EndReadComplex()

EndReadObject  protected

 

method EndReadObject

 

void EndReadObject()

 

Sub EndReadObject()

EndWriteComplex  protected

 

method EndWriteComplex(value: ComplexType)

 

void EndWriteComplex(ComplexType value)

 

Sub EndWriteComplex(value As ComplexType)

Parameters:

  • value:

EndWriteObject  protected

 

method EndWriteObject

 

void EndWriteObject()

 

Sub EndWriteObject()

Read    (declared in Serializer)

The general method for reading that calls specific ReadXXX method dependently on the type of an object to read.

 

method Read(name: String; type: Type; format: StreamingFormat): Object

 

Object Read(String name, Type type, StreamingFormat format)

 

Function Read(name As String, type As Type, format As StreamingFormat) As Object

Parameters:

  • name:
  • type:
  • format:

ReadAnsiString

Reads string from stream in ANSI format. String is stored as a sequence of byte with preceding Int32 value which contains string length.

 

method ReadAnsiString: String

 

String ReadAnsiString()

 

Function ReadAnsiString() As String

ReadAnsiString (String): String

Reads ANSI string value from the specified Bin message serialized object and returns it.

 

method ReadAnsiString(name: String): String

 

String ReadAnsiString(String name)

 

Function ReadAnsiString(name As String) As String

Parameters:

  • name: name of the AnsiString object to read.

ReadArray

Reads array of type type and specified StreamingFormat. Preceding array's data, byte with value equals to 1 and Int32 value with array length.

 

method ReadArray(name: String; type: Type; format: StreamingFormat): Array

 

Array ReadArray(String name, Type type, StreamingFormat format)

 

Function ReadArray(name As String, type As Type, format As StreamingFormat) As Array

Parameters:

  • name: name of the Array object to read.
  • type: type of the array object to read
  • format: data serialization format of the Array object

ReadBinary

Returns Binary class instance. Preceding binary data, byte with value not equals to 0 and Int32 value with data length.

 

method ReadBinary(name: String): Binary

 

Binary ReadBinary(String name)

 

Function ReadBinary(name As String) As Binary

Parameters:

  • name: name of the binary object to read

ReadBoolean

Returns boolean value which is calculated as TRUE if non-zero Int32 value was read from stream, FALSE otherwise.

 

method ReadBoolean(name: String): Boolean

 

Boolean ReadBoolean(String name)

 

Function ReadBoolean(name As String) As Boolean

Parameters:

  • name: name of the boolean object to read

ReadByte

Returns byte value from stream.

 

method ReadByte: Byte

 

Byte ReadByte()

 

Function ReadByte() As Byte

ReadComplex    (declared in Serializer)

 

method ReadComplex(name: String; type: Type): ComplexType

 

ComplexType ReadComplex(String name, Type type)

 

Function ReadComplex(name As String, type As Type) As ComplexType

Parameters:

  • name:
  • type:

ReadCurrency

Returns currency value from stream.

 

method ReadCurrency(name: String): Decimal

 

Decimal ReadCurrency(String name)

 

Function ReadCurrency(name As String) As Decimal

Parameters:

  • name: name of the currency object to read

ReadCustomEnum

Returns enum value as Int32 from stream and wrap it with ICustomEnum.

 

method ReadCustomEnum(name: String): ICustomEnum

 

ICustomEnum ReadCustomEnum(String name)

 

Function ReadCustomEnum(name As String) As ICustomEnum

Parameters:


ReadDateTime

Returns DateTime value from stream.

 

method ReadDateTime(name: String): DateTime

 

DateTime ReadDateTime(String name)

 

Function ReadDateTime(name As String) As DateTime

Parameters:

  • name: name of the datetime object to read

ReadDecimal

Returns decimal value from stream.

 

method ReadDecimal(name: String): Decimal

 

Decimal ReadDecimal(String name)

 

Function ReadDecimal(name As String) As Decimal

Parameters:

  • name: name of the decimal object to read

ReadDouble

Returns double value from stream.

 

method ReadDouble(name: String): Double

 

Double ReadDouble(String name)

 

Function ReadDouble(name As String) As Double

Parameters:

  • name: name of the double object to read

ReadEnum

Returns Enum value from stream. Reads from stream Int32 value and interpretate it as Enum.

 

method ReadEnum(name: String; type: Type): Enum

 

Enum ReadEnum(String name, Type type)

 

Function ReadEnum(name As String, type As Type) As Enum

Parameters:

  • name: name of the Enum object to read
  • type: type of the Enum object to read

ReadException

 

method ReadException(type: Type; message: String; isFromServer: Boolean): Exception

 

Exception ReadException(Type type, String message, Boolean isFromServer)

 

Function ReadException(type As Type, message As String, isFromServer As Boolean) As Exception

Parameters:

  • type:
  • message:
  • isFromServer:

ReadFromCompressedStream

Writes Int32 value to stream.

 

method ReadFromCompressedStream(stream: Stream; maxSize: Int32; enforceMaxSize: Boolean)

 

void ReadFromCompressedStream(Stream stream, Int32 maxSize, Boolean enforceMaxSize)

 

Sub ReadFromCompressedStream(stream As Stream, maxSize As Int32, enforceMaxSize As Boolean)

Parameters:

  • stream: decompressed stream
  • maxSize: max value for the size of decompressed message
  • enforceMaxSize: if equals FALSE then maxDecompressedMessageSize is ignored, if TRUE then maxDecompressedMessageSize is used.

ReadFromStream (Stream)

Replaces current Stream property value with input stream.

 

method ReadFromStream(stream: Stream)

 

void ReadFromStream(Stream stream)

 

Sub ReadFromStream(stream As Stream)

Parameters:

  • stream: Stream object to read

ReadFromStream (Stream, Int32, Boolean)

Replaces current Stream property value with input stream.

 

method ReadFromStream(stream: Stream; maxMessageSize: Int32; enforceMaxSize: Boolean)

 

void ReadFromStream(Stream stream, Int32 maxMessageSize, Boolean enforceMaxSize)

 

Sub ReadFromStream(stream As Stream, maxMessageSize As Int32, enforceMaxSize As Boolean)

Parameters:

  • stream: Stream object to read
  • maxMessageSize:
  • enforceMaxSize:

ReadGenericArray

Reads array of type type and specified StreamingFormat. Preceding array's data, byte with value equals to 1 and Int32 value with array length.

 

method ReadGenericArray(name: String; type: Type; format: StreamingFormat): IList

 

IList ReadGenericArray(String name, Type type, StreamingFormat format)

 

Function ReadGenericArray(name As String, type As Type, format As StreamingFormat) As IList

Parameters:

  • name: name of the generic array object to read
  • type: type of generic array object to read
  • format: deserialization format of generic array

ReadGuid

Reads 16 bytes from Stream as a GUID.

 

method ReadGuid(name: String): Guid

 

Guid ReadGuid(String name)

 

Function ReadGuid(name As String) As Guid

Parameters:

  • name: name of GUID object to read

ReadInt16

Reads Int16 value from stream.

 

method ReadInt16: Int32

 

Int32 ReadInt16()

 

Function ReadInt16() As Int32

ReadInt32

Reads Int32 value from stream.

 

method ReadInt32: Int32

 

Int32 ReadInt32()

 

Function ReadInt32() As Int32

ReadInt32 (String): Int32

Reads Int32 value from stream.

 

method ReadInt32(name: String): Int32

 

Int32 ReadInt32(String name)

 

Function ReadInt32(name As String) As Int32

Parameters:

  • name: name of Int32 object to read

ReadInt64

Reads Int64 value from stream.

 

method ReadInt64(name: String): Int64

 

Int64 ReadInt64(String name)

 

Function ReadInt64(name As String) As Int64

Parameters:

  • name: name of Int64 object to read

ReadObject    (declared in Serializer)

 

method ReadObject(name: String; type: Type): Object

 

Object ReadObject(String name, Type type)

 

Function ReadObject(name As String, type As Type) As Object

Parameters:

  • name:
  • type:

ReadObjectData    (declared in Serializer)

 

method ReadObjectData(value: Object)

 

void ReadObjectData(Object value)

 

Sub ReadObjectData(value As Object)

Parameters:

  • value:

ReadUtf8String

Reads string from stream in UTF8 format. String is stored as a sequence of byte with preceding Int32 value which contains string length.

 

method ReadUtf8String: String

 

String ReadUtf8String()

 

Function ReadUtf8String() As String

ReadUtf8String (String): String

Reads string from stream in UTF8 format. String is stored as a sequence of byte with preceding Int32 value which contains string length.

 

method ReadUtf8String(name: String): String

 

String ReadUtf8String(String name)

 

Function ReadUtf8String(name As String) As String

Parameters:

  • name: name of Utf8String object to read

ReadVariant

Reads object from stream which can be any numerical type, currency, DateTime, Array, binary data, string, boolean or GUID. Data for object is preceded with Int32 type code value which is interpreted as a Variant Code or equals to 0x2011 when there is simple binary data.

 

method ReadVariant(name: String): Object

 

Object ReadVariant(String name)

 

Function ReadVariant(name As String) As Object

Parameters:

  • name: name of Variant object to read

ReadWideString

Reads string from stream in UTF32 format. String is stored as a sequence of byte with preceding Int32 value which contains string length in characters (so it occupies twice as preceding length value, bytes).

 

method ReadWideString: String

 

String ReadWideString()

 

Function ReadWideString() As String

ReadWideString (String): String

Reads string from stream in UTF32 format. String is stored as a sequence of byte with preceding Int32 value which contains string length in characters (so it occupies twice as preceding length value, bytes).

 

method ReadWideString(name: String): String

 

String ReadWideString(String name)

 

Function ReadWideString(name As String) As String

Parameters:

  • name: name of WideString object to read

ReadXml

Reads string in UTF8 encoding and tries to parse it as XML.

 

method ReadXml(name: String): XmlNode

 

XmlNode ReadXml(String name)

 

Function ReadXml(name As String) As XmlNode

Parameters:

  • name: name of Xml object to read

TryReadUtf8String

Equivalent to ReadUtf8String

 

method TryReadUtf8String: String

 

String TryReadUtf8String()

 

Function TryReadUtf8String() As String

Write (String, Object, StreamingFormat)    (declared in Serializer)

 

method Write(name: String; value: Object; format: StreamingFormat)

 

void Write(String name, Object value, StreamingFormat format)

 

Sub Write(name As String, value As Object, format As StreamingFormat)

Parameters:

  • name:
  • value:
  • format:

Write (String, Object, Type, StreamingFormat)    (declared in Serializer)

The general method for writing that calls specific WriteXXX method dependently on the type of an object to write.

 

method Write(name: String; value: Object; type: Type; format: StreamingFormat)

 

void Write(String name, Object value, Type type, StreamingFormat format)

 

Sub Write(name As String, value As Object, type As Type, format As StreamingFormat)

Parameters:

  • name:
  • value:
  • type:
  • format:

WriteAnsiString (String, String)

 

method WriteAnsiString(name: String; value: String)

 

void WriteAnsiString(String name, String value)

 

Sub WriteAnsiString(name As String, value As String)

Parameters:

  • name:
  • value:

WriteAnsiString (String)

 

method WriteAnsiString(value: String)

 

void WriteAnsiString(String value)

 

Sub WriteAnsiString(value As String)

Parameters:

  • value:

WriteArray

If value not nil then writes byte with value equals to 1, Int32 value with array length, and array data. If value is nil then simply writes 0 to stream.

 

method WriteArray(name: String; value: Array; format: StreamingFormat)

 

void WriteArray(String name, Array value, StreamingFormat format)

 

Sub WriteArray(name As String, value As Array, format As StreamingFormat)

Parameters:

  • name: name of Array object to write
  • value: value of the Array object to write
  • format: serialization format of the Array object

WriteBinary

If value not nil then writes byte with value equals to 1, Int32 value with stream length, and copy data from input stream to Stream property. If value is nil then simply writes 0 to stream.

 

method WriteBinary(name: String; value: Stream)

 

void WriteBinary(String name, Stream value)

 

Sub WriteBinary(name As String, value As Stream)

Parameters:

  • name: name of the Binary object to write
  • value: value of the Binary object to write

WriteBoolean

Writes Int32 value equals to 1 if value is TRUE otherwise - 0.

 

method WriteBoolean(name: String; value: Boolean)

 

void WriteBoolean(String name, Boolean value)

 

Sub WriteBoolean(name As String, value As Boolean)

Parameters:

  • name: name of the Boolean object to write
  • value: value of the Boolean object to write

WriteByte

Writes byte value to stream.

 

method WriteByte(value: Byte)

 

void WriteByte(Byte value)

 

Sub WriteByte(value As Byte)

Parameters:

  • value: Byte value to write

WriteComplex    (declared in Serializer)

 

method WriteComplex(name: String; value: ComplexType)

 

void WriteComplex(String name, ComplexType value)

 

Sub WriteComplex(name As String, value As ComplexType)

Parameters:

  • name:
  • value:

WriteCurrency

Writes decimal value to stream.

 

method WriteCurrency(name: String; value: Decimal)

 

void WriteCurrency(String name, Decimal value)

 

Sub WriteCurrency(name As String, value As Decimal)

Parameters:

  • name: name of the Currency object to write
  • value: value of the Currency object to write

WriteCustomEnum

Writes enum value wraped to ICustomEnum interface to stream.

 

method WriteCustomEnum(name: String; value: ICustomEnum)

 

void WriteCustomEnum(String name, ICustomEnum value)

 

Sub WriteCustomEnum(name As String, value As ICustomEnum)

Parameters:


WriteDateTime

Writes DateTime value to stream.

 

method WriteDateTime(name: String; value: DateTime)

 

void WriteDateTime(String name, DateTime value)

 

Sub WriteDateTime(name As String, value As DateTime)

Parameters:

  • name: name of the DateTime object to write
  • value: value of the DateTime object to write

WriteDecimal

Writes decimal value to stream.

 

method WriteDecimal(name: String; value: Decimal)

 

void WriteDecimal(String name, Decimal value)

 

Sub WriteDecimal(name As String, value As Decimal)

Parameters:

  • name: name of the Decimal object to write
  • value: value of the Decimal object to write

WriteDouble

Writes decimal value to stream.

 

method WriteDouble(name: String; value: Double)

 

void WriteDouble(String name, Double value)

 

Sub WriteDouble(name As String, value As Double)

Parameters:

  • name: name of the Double object to write
  • value: value of the Double object to write

WriteEnum

Writes enum value to stream.

 

method WriteEnum(name: String; value: Enum)

 

void WriteEnum(String name, Enum value)

 

Sub WriteEnum(name As String, value As Enum)

Parameters:

  • name: name of the Enum object to write
  • value: value of the Enum object to write

WriteGenericArray

If value not nil then writes byte with value equals to 1, Int32 value with array length, and array data. If value is nil then simply writes 0 to stream.

 

method WriteGenericArray(name: String; value: IList; format: StreamingFormat)

 

void WriteGenericArray(String name, IList value, StreamingFormat format)

 

Sub WriteGenericArray(name As String, value As IList, format As StreamingFormat)

Parameters:

  • name: name of the generic array object to write
  • value: value of the generic array object to write
  • format: data serialization format of the generic array object

WriteGuid

Writes GUID to stream.

 

method WriteGuid(name: String; value: Guid)

 

void WriteGuid(String name, Guid value)

 

Sub WriteGuid(name As String, value As Guid)

Parameters:

  • name: name of the Guid object to write
  • value: value of the Guid object to write

WriteInt16

Writes Int16 value to stream.

 

method WriteInt16(value: Int32)

 

void WriteInt16(Int32 value)

 

Sub WriteInt16(value As Int32)

Parameters:

  • value: Int16 value to write

WriteInt32 (String, Int32)

Writes Int32 value to stream.

 

method WriteInt32(name: String; value: Int32)

 

void WriteInt32(String name, Int32 value)

 

Sub WriteInt32(name As String, value As Int32)

Parameters:

  • name:
  • value: value of the Int32 object to write

WriteInt32 (Int32)

 

method WriteInt32(value: Int32)

 

void WriteInt32(Int32 value)

 

Sub WriteInt32(value As Int32)

Parameters:

  • value:

WriteInt64

Writes Int64 value to stream.

 

method WriteInt64(name: String; value: Int64)

 

void WriteInt64(String name, Int64 value)

 

Sub WriteInt64(name As String, value As Int64)

Parameters:

  • name: name of the Int64 object to write
  • value: value of the Int64 object to write

WriteObject    (declared in Serializer)

This method is a wrapper for Write method. It defines a type and streaming format of passed object.

 

method WriteObject(name: String; value: Object)

 

void WriteObject(String name, Object value)

 

Sub WriteObject(name As String, value As Object)

Parameters:

  • name:
  • value:

WriteObjectData    (declared in Serializer)

 

method WriteObjectData(value: Object)

 

void WriteObjectData(Object value)

 

Sub WriteObjectData(value As Object)

Parameters:

  • value:

WriteToCompressedStream

Compress Stream property value with Deflater class and writes it to specified in stream parameter stream.

 

method WriteToCompressedStream(stream: Stream)

 

void WriteToCompressedStream(Stream stream)

 

Sub WriteToCompressedStream(stream As Stream)

Parameters:

  • stream: stream object to write

WriteToStream

Writes ALL content of stream property to specified stream.

 

method WriteToStream(stream: Stream)

 

void WriteToStream(Stream stream)

 

Sub WriteToStream(stream As Stream)

Parameters:

  • stream: Stream object to write

WriteUtf8String (String, String)

 

method WriteUtf8String(name: String; value: String)

 

void WriteUtf8String(String name, String value)

 

Sub WriteUtf8String(name As String, value As String)

Parameters:

  • name:
  • value:

WriteUtf8String (String)

 

method WriteUtf8String(value: String)

 

void WriteUtf8String(String value)

 

Sub WriteUtf8String(value As String)

Parameters:

  • value:

WriteVariant

Writes to stream any object of any type.

 

method WriteVariant(name: String; value: Object)

 

void WriteVariant(String name, Object value)

 

Sub WriteVariant(name As String, value As Object)

Parameters:

  • name: name of the Variant object to write
  • value: value of the Variant object to write

WriteWideString (String, String)

 

method WriteWideString(name: String; value: String)

 

void WriteWideString(String name, String value)

 

Sub WriteWideString(name As String, value As String)

Parameters:

  • name:
  • value:

WriteWideString (String)

 

method WriteWideString(value: String)

 

void WriteWideString(String value)

 

Sub WriteWideString(value As String)

Parameters:

  • value:

WriteXml

Write XmlNode object to stream.

 

method WriteXml(name: String; value: XmlNode)

 

void WriteXml(String name, XmlNode value)

 

Sub WriteXml(name As String, value As XmlNode)

Parameters:

  • name: name of the XmlNode object to write
  • value: value of the XmlNode object to write