C# Класс Amqp.Types.Encoder

Encodes or decodes AMQP types.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AddKnownDescribed ( Amqp.Types.Descriptor descriptor, CreateDescribed ctor ) : void

Adds a factory for a custom described type, usually for decoding.

DateTimeToTimestamp ( System.DateTime dateTime ) : long

Converts a DateTime value to AMQP timestamp (milliseconds from Unix epoch)

ReadArray ( System.ByteBuffer buffer, byte formatCode ) : Array

Reads an array value from a buffer.

ReadBinary ( System.ByteBuffer buffer, byte formatCode ) : byte[]

Reads a binary value from a buffer.

ReadBoolean ( System.ByteBuffer buffer, byte formatCode ) : bool

Reads a boolean value from a buffer.

ReadByte ( System.ByteBuffer buffer, byte formatCode ) : sbyte

Reads a signed byte from a buffer.

ReadChar ( System.ByteBuffer buffer, byte formatCode ) : char

Reads a char value from a buffer.

ReadDescribed ( System.ByteBuffer buffer, byte formatCode ) : object

Reads a described value from a buffer.

ReadDouble ( System.ByteBuffer buffer, byte formatCode ) : double

Reads a 64-bit floating-point value from a buffer.

ReadFloat ( System.ByteBuffer buffer, byte formatCode ) : float

Reads a 32-bit floating-point value from a buffer.

ReadInt ( System.ByteBuffer buffer, byte formatCode ) : int

Reads a signed 32-bit integer from a buffer.

ReadList ( System.ByteBuffer buffer, byte formatCode ) : List

Reads a list value from a buffer.

ReadLong ( System.ByteBuffer buffer, byte formatCode ) : long

Reads a signed 64-bit integer from a buffer.

ReadMap ( System.ByteBuffer buffer, byte formatCode ) : Amqp.Types.Map

Reads a map value from a buffer.

ReadObject ( System.ByteBuffer buffer ) : object

Reads an object from a buffer.

ReadObject ( System.ByteBuffer buffer, byte formatCode ) : object

Reads an object from a buffer.

ReadShort ( System.ByteBuffer buffer, byte formatCode ) : short

Reads a signed 16-bit integer from a buffer.

ReadString ( System.ByteBuffer buffer, byte formatCode ) : string

Reads a string value from a buffer.

ReadSymbol ( System.ByteBuffer buffer, byte formatCode ) : Amqp.Types.Symbol

Reads a symbol value from a buffer.

ReadTimestamp ( System.ByteBuffer buffer, byte formatCode ) : System.DateTime

Reads a timestamp value from a buffer.

ReadUByte ( System.ByteBuffer buffer, byte formatCode ) : byte

Reads an unsigned byte value from a buffer.

ReadUInt ( System.ByteBuffer buffer, byte formatCode ) : uint

Reads an unsigned 32-bit integer from a buffer.

ReadULong ( System.ByteBuffer buffer, byte formatCode ) : ulong

Reads an unsigned 64-bit integer from a buffer.

ReadUShort ( System.ByteBuffer buffer, byte formatCode ) : ushort

Reads an unsigned 16-bit integer from a buffer.

ReadUuid ( System.ByteBuffer buffer, byte formatCode ) : System.Guid

Reads a uuid value from a buffer.

TimestampToDateTime ( long timestamp ) : System.DateTime

Converts an AMQP timestamp ((milliseconds from Unix epoch)) to a DateTime.

WriteArray ( System.ByteBuffer buffer, Array value ) : void

Writes an array value to a buffer.

WriteBinary ( System.ByteBuffer buffer, byte value, bool smallEncoding ) : void

Writes a binary value to a buffer.

WriteBoolean ( System.ByteBuffer buffer, bool value, bool smallEncoding ) : void

Writes a boolean value to a buffer.

WriteByte ( System.ByteBuffer buffer, sbyte value ) : void

Writes a signed byte value to a buffer.

WriteChar ( System.ByteBuffer buffer, char value ) : void

Writes a char value to a buffer.

WriteDouble ( System.ByteBuffer buffer, double value ) : void

Writes a 64-bit floating-point value to a buffer.

WriteFloat ( System.ByteBuffer buffer, float value ) : void

Writes a 32-bit floating-point value to a buffer.

WriteInt ( System.ByteBuffer buffer, int value, bool smallEncoding ) : void

Writes a signed 32-bit integer value to a buffer.

WriteList ( System.ByteBuffer buffer, IList value, bool smallEncoding ) : void

Writes a list value to a buffer.

WriteLong ( System.ByteBuffer buffer, long value, bool smallEncoding ) : void

Writes a signed 64-bit integer value to a buffer.

WriteMap ( System.ByteBuffer buffer, Amqp.Types.Map value, bool smallEncoding ) : void

Writes a map value to a buffer.

WriteObject ( System.ByteBuffer buffer, object value, bool smallEncoding = true ) : void

Writes an AMQP object to a buffer.

WriteShort ( System.ByteBuffer buffer, short value ) : void

Writes a signed 16-bit integer value to a buffer.

WriteString ( System.ByteBuffer buffer, string value, bool smallEncoding ) : void

Writes a string value to a buffer.

WriteSymbol ( System.ByteBuffer buffer, Amqp.Types.Symbol value, bool smallEncoding ) : void

Writes a symbol value to a buffer.

WriteTimestamp ( System.ByteBuffer buffer, System.DateTime value ) : void

Writes a timestamp value to a buffer.

WriteUByte ( System.ByteBuffer buffer, byte value ) : void

Writes an unsigned byte value to a buffer.

WriteUInt ( System.ByteBuffer buffer, uint value, bool smallEncoding ) : void

Writes an unsigned 32-bit integer value to a buffer.

WriteULong ( System.ByteBuffer buffer, ulong value, bool smallEncoding ) : void

Writes an unsigned 64-bit integer value to a buffer.

WriteUShort ( System.ByteBuffer buffer, ushort value ) : void

Writes an unsigned 16-bit integer value to a buffer.

WriteUuid ( System.ByteBuffer buffer, System.Guid value ) : void

Writes a uuid value to a buffer.

Приватные методы

Метод Описание
Encoder ( ) : System
GetSerializer ( byte formatCode ) : Serializer
Initialize ( ) : void
InvalidFormatCodeException ( byte formatCode, int offset ) : AmqpException
InvalidFormatCodeException ( byte formatCode, int offset ) : Exception
InvalidMapCountException ( int count ) : AmqpException
InvalidMapCountException ( int count ) : Exception
ReadBinaryBuffer ( System.ByteBuffer buffer ) : System.ByteBuffer
ReadFormatCode ( System.ByteBuffer buffer ) : byte
ReadString ( System.ByteBuffer buffer, byte formatCode, byte code8, byte code32, string type ) : string
TryGetCodec ( Type type, Encode &encoder, Decode &decoder ) : bool
TypeNotSupportedException ( Type type ) : AmqpException
TypeNotSupportedException ( Type type ) : Exception
WriteBinaryBuffer ( System.ByteBuffer buffer, System.ByteBuffer value ) : void

Описание методов

AddKnownDescribed() публичный статический Метод

Adds a factory for a custom described type, usually for decoding.
public static AddKnownDescribed ( Amqp.Types.Descriptor descriptor, CreateDescribed ctor ) : void
descriptor Amqp.Types.Descriptor The descriptor of the type.
ctor CreateDescribed The delegate to invoke to create the object.
Результат void

DateTimeToTimestamp() публичный статический Метод

Converts a DateTime value to AMQP timestamp (milliseconds from Unix epoch)
public static DateTimeToTimestamp ( System.DateTime dateTime ) : long
dateTime System.DateTime The DateTime value to convert.
Результат long

ReadArray() публичный статический Метод

Reads an array value from a buffer.
public static ReadArray ( System.ByteBuffer buffer, byte formatCode ) : Array
buffer System.ByteBuffer The buffer to read.
formatCode byte The format code of the value.
Результат System.Array

ReadBinary() публичный статический Метод

Reads a binary value from a buffer.
public static ReadBinary ( System.ByteBuffer buffer, byte formatCode ) : byte[]
buffer System.ByteBuffer The buffer to read.
formatCode byte The format code of the value.
Результат byte[]

ReadBoolean() публичный статический Метод

Reads a boolean value from a buffer.
public static ReadBoolean ( System.ByteBuffer buffer, byte formatCode ) : bool
buffer System.ByteBuffer The buffer to read.
formatCode byte The format code of the value.
Результат bool

ReadByte() публичный статический Метод

Reads a signed byte from a buffer.
public static ReadByte ( System.ByteBuffer buffer, byte formatCode ) : sbyte
buffer System.ByteBuffer The buffer to read.
formatCode byte The format code of the value.
Результат sbyte

ReadChar() публичный статический Метод

Reads a char value from a buffer.
public static ReadChar ( System.ByteBuffer buffer, byte formatCode ) : char
buffer System.ByteBuffer The buffer to read.
formatCode byte The format code of the value.
Результат char

ReadDescribed() публичный статический Метод

Reads a described value from a buffer.
public static ReadDescribed ( System.ByteBuffer buffer, byte formatCode ) : object
buffer System.ByteBuffer The buffer to read.
formatCode byte The format code of the value.
Результат object

ReadDouble() публичный статический Метод

Reads a 64-bit floating-point value from a buffer.
public static ReadDouble ( System.ByteBuffer buffer, byte formatCode ) : double
buffer System.ByteBuffer The buffer to read.
formatCode byte The format code of the value.
Результат double

ReadFloat() публичный статический Метод

Reads a 32-bit floating-point value from a buffer.
public static ReadFloat ( System.ByteBuffer buffer, byte formatCode ) : float
buffer System.ByteBuffer The buffer to read.
formatCode byte The format code of the value.
Результат float

ReadInt() публичный статический Метод

Reads a signed 32-bit integer from a buffer.
public static ReadInt ( System.ByteBuffer buffer, byte formatCode ) : int
buffer System.ByteBuffer The buffer to read.
formatCode byte The format code of the value.
Результат int

ReadList() публичный статический Метод

Reads a list value from a buffer.
public static ReadList ( System.ByteBuffer buffer, byte formatCode ) : List
buffer System.ByteBuffer The buffer to read.
formatCode byte The format code of the value.
Результат List

ReadLong() публичный статический Метод

Reads a signed 64-bit integer from a buffer.
public static ReadLong ( System.ByteBuffer buffer, byte formatCode ) : long
buffer System.ByteBuffer The buffer to read.
formatCode byte The format code of the value.
Результат long

ReadMap() публичный статический Метод

Reads a map value from a buffer.
public static ReadMap ( System.ByteBuffer buffer, byte formatCode ) : Amqp.Types.Map
buffer System.ByteBuffer The buffer to read.
formatCode byte The format code of the value.
Результат Amqp.Types.Map

ReadObject() публичный статический Метод

Reads an object from a buffer.
public static ReadObject ( System.ByteBuffer buffer ) : object
buffer System.ByteBuffer The buffer to read.
Результат object

ReadObject() публичный статический Метод

Reads an object from a buffer.
public static ReadObject ( System.ByteBuffer buffer, byte formatCode ) : object
buffer System.ByteBuffer The buffer to read.
formatCode byte The format code of the value.
Результат object

ReadShort() публичный статический Метод

Reads a signed 16-bit integer from a buffer.
public static ReadShort ( System.ByteBuffer buffer, byte formatCode ) : short
buffer System.ByteBuffer The buffer to read.
formatCode byte The format code of the value.
Результат short

ReadString() публичный статический Метод

Reads a string value from a buffer.
public static ReadString ( System.ByteBuffer buffer, byte formatCode ) : string
buffer System.ByteBuffer The buffer to read.
formatCode byte The format code of the value.
Результат string

ReadSymbol() публичный статический Метод

Reads a symbol value from a buffer.
public static ReadSymbol ( System.ByteBuffer buffer, byte formatCode ) : Amqp.Types.Symbol
buffer System.ByteBuffer The buffer to read.
formatCode byte The format code of the value.
Результат Amqp.Types.Symbol

ReadTimestamp() публичный статический Метод

Reads a timestamp value from a buffer.
public static ReadTimestamp ( System.ByteBuffer buffer, byte formatCode ) : System.DateTime
buffer System.ByteBuffer The buffer to read.
formatCode byte The format code of the value.
Результат System.DateTime

ReadUByte() публичный статический Метод

Reads an unsigned byte value from a buffer.
public static ReadUByte ( System.ByteBuffer buffer, byte formatCode ) : byte
buffer System.ByteBuffer The buffer to read.
formatCode byte The format code of the value.
Результат byte

ReadUInt() публичный статический Метод

Reads an unsigned 32-bit integer from a buffer.
public static ReadUInt ( System.ByteBuffer buffer, byte formatCode ) : uint
buffer System.ByteBuffer The buffer to read.
formatCode byte The format code of the value.
Результат uint

ReadULong() публичный статический Метод

Reads an unsigned 64-bit integer from a buffer.
public static ReadULong ( System.ByteBuffer buffer, byte formatCode ) : ulong
buffer System.ByteBuffer The buffer to read.
formatCode byte The format code of the value.
Результат ulong

ReadUShort() публичный статический Метод

Reads an unsigned 16-bit integer from a buffer.
public static ReadUShort ( System.ByteBuffer buffer, byte formatCode ) : ushort
buffer System.ByteBuffer The buffer to read.
formatCode byte The format code of the value.
Результат ushort

ReadUuid() публичный статический Метод

Reads a uuid value from a buffer.
public static ReadUuid ( System.ByteBuffer buffer, byte formatCode ) : System.Guid
buffer System.ByteBuffer The buffer to read.
formatCode byte The format code of the value.
Результат System.Guid

TimestampToDateTime() публичный статический Метод

Converts an AMQP timestamp ((milliseconds from Unix epoch)) to a DateTime.
public static TimestampToDateTime ( long timestamp ) : System.DateTime
timestamp long The AMQP timestamp to convert.
Результат System.DateTime

WriteArray() публичный статический Метод

Writes an array value to a buffer.
public static WriteArray ( System.ByteBuffer buffer, Array value ) : void
buffer System.ByteBuffer The buffer to write.
value System.Array The array value.
Результат void

WriteBinary() публичный статический Метод

Writes a binary value to a buffer.
public static WriteBinary ( System.ByteBuffer buffer, byte value, bool smallEncoding ) : void
buffer System.ByteBuffer The buffer to write.
value byte The binary value.
smallEncoding bool if true, try using small encoding if possible.
Результат void

WriteBoolean() публичный статический Метод

Writes a boolean value to a buffer.
public static WriteBoolean ( System.ByteBuffer buffer, bool value, bool smallEncoding ) : void
buffer System.ByteBuffer The buffer to write.
value bool The boolean value.
smallEncoding bool if true, try using small encoding if possible.
Результат void

WriteByte() публичный статический Метод

Writes a signed byte value to a buffer.
public static WriteByte ( System.ByteBuffer buffer, sbyte value ) : void
buffer System.ByteBuffer The buffer to write.
value sbyte The signed byte value.
Результат void

WriteChar() публичный статический Метод

Writes a char value to a buffer.
public static WriteChar ( System.ByteBuffer buffer, char value ) : void
buffer System.ByteBuffer The buffer to write.
value char The char value.
Результат void

WriteDouble() публичный статический Метод

Writes a 64-bit floating-point value to a buffer.
public static WriteDouble ( System.ByteBuffer buffer, double value ) : void
buffer System.ByteBuffer The buffer to write.
value double The 64-bit floating-point value.
Результат void

WriteFloat() публичный статический Метод

Writes a 32-bit floating-point value to a buffer.
public static WriteFloat ( System.ByteBuffer buffer, float value ) : void
buffer System.ByteBuffer The buffer to write.
value float The 32-bit floating-point value.
Результат void

WriteInt() публичный статический Метод

Writes a signed 32-bit integer value to a buffer.
public static WriteInt ( System.ByteBuffer buffer, int value, bool smallEncoding ) : void
buffer System.ByteBuffer The buffer to write.
value int The signed 32-bit integer value.
smallEncoding bool if true, try using small encoding if possible.
Результат void

WriteList() публичный статический Метод

Writes a list value to a buffer.
public static WriteList ( System.ByteBuffer buffer, IList value, bool smallEncoding ) : void
buffer System.ByteBuffer The buffer to write.
value IList The list value.
smallEncoding bool if true, try using small encoding if possible.
Результат void

WriteLong() публичный статический Метод

Writes a signed 64-bit integer value to a buffer.
public static WriteLong ( System.ByteBuffer buffer, long value, bool smallEncoding ) : void
buffer System.ByteBuffer The buffer to write.
value long The signed 64-bit integer value.
smallEncoding bool if true, try using small encoding if possible.
Результат void

WriteMap() публичный статический Метод

Writes a map value to a buffer.
public static WriteMap ( System.ByteBuffer buffer, Amqp.Types.Map value, bool smallEncoding ) : void
buffer System.ByteBuffer The buffer to write.
value Amqp.Types.Map The map value.
smallEncoding bool if true, try using small encoding if possible.
Результат void

WriteObject() публичный статический Метод

Writes an AMQP object to a buffer.
public static WriteObject ( System.ByteBuffer buffer, object value, bool smallEncoding = true ) : void
buffer System.ByteBuffer The buffer to write.
value object The AMQP value.
smallEncoding bool if true, try using small encoding if possible.
Результат void

WriteShort() публичный статический Метод

Writes a signed 16-bit integer value to a buffer.
public static WriteShort ( System.ByteBuffer buffer, short value ) : void
buffer System.ByteBuffer The buffer to write.
value short The signed 16-bit integer value.
Результат void

WriteString() публичный статический Метод

Writes a string value to a buffer.
public static WriteString ( System.ByteBuffer buffer, string value, bool smallEncoding ) : void
buffer System.ByteBuffer The buffer to write.
value string The string value.
smallEncoding bool if true, try using small encoding if possible.
Результат void

WriteSymbol() публичный статический Метод

Writes a symbol value to a buffer.
public static WriteSymbol ( System.ByteBuffer buffer, Amqp.Types.Symbol value, bool smallEncoding ) : void
buffer System.ByteBuffer The buffer to write.
value Amqp.Types.Symbol The symbol value.
smallEncoding bool if true, try using small encoding if possible.
Результат void

WriteTimestamp() публичный статический Метод

Writes a timestamp value to a buffer.
public static WriteTimestamp ( System.ByteBuffer buffer, System.DateTime value ) : void
buffer System.ByteBuffer The buffer to write.
value System.DateTime The timestamp value which is the milliseconds since UNIX epoch.
Результат void

WriteUByte() публичный статический Метод

Writes an unsigned byte value to a buffer.
public static WriteUByte ( System.ByteBuffer buffer, byte value ) : void
buffer System.ByteBuffer The buffer to write.
value byte The unsigned byte value.
Результат void

WriteUInt() публичный статический Метод

Writes an unsigned 32-bit integer value to a buffer.
public static WriteUInt ( System.ByteBuffer buffer, uint value, bool smallEncoding ) : void
buffer System.ByteBuffer The buffer to write.
value uint The unsigned 32-bit integer value.
smallEncoding bool if true, try using small encoding if possible.
Результат void

WriteULong() публичный статический Метод

Writes an unsigned 64-bit integer value to a buffer.
public static WriteULong ( System.ByteBuffer buffer, ulong value, bool smallEncoding ) : void
buffer System.ByteBuffer The buffer to write.
value ulong The unsigned 64-bit integer value.
smallEncoding bool if true, try using small encoding if possible.
Результат void

WriteUShort() публичный статический Метод

Writes an unsigned 16-bit integer value to a buffer.
public static WriteUShort ( System.ByteBuffer buffer, ushort value ) : void
buffer System.ByteBuffer The buffer to write.
value ushort The unsigned 16-bit integer value.
Результат void

WriteUuid() публичный статический Метод

Writes a uuid value to a buffer.
public static WriteUuid ( System.ByteBuffer buffer, System.Guid value ) : void
buffer System.ByteBuffer The buffer to write.
value System.Guid The uuid value.
Результат void