C# Class Amqp.Types.Encoder

Encodes or decodes AMQP types.
Afficher le fichier Open project: xamarin/mini-hacks Class Usage Examples

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
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

Method Details

AddKnownDescribed() public static méthode

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.
Résultat void

DateTimeToTimestamp() public static méthode

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.
Résultat long

ReadArray() public static méthode

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.
Résultat System.Array

ReadBinary() public static méthode

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.
Résultat byte[]

ReadBoolean() public static méthode

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.
Résultat bool

ReadByte() public static méthode

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.
Résultat sbyte

ReadChar() public static méthode

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.
Résultat char

ReadDescribed() public static méthode

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.
Résultat object

ReadDouble() public static méthode

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.
Résultat double

ReadFloat() public static méthode

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.
Résultat float

ReadInt() public static méthode

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.
Résultat int

ReadList() public static méthode

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.
Résultat List

ReadLong() public static méthode

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.
Résultat long

ReadMap() public static méthode

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.
Résultat Amqp.Types.Map

ReadObject() public static méthode

Reads an object from a buffer.
public static ReadObject ( System.ByteBuffer buffer ) : object
buffer System.ByteBuffer The buffer to read.
Résultat object

ReadObject() public static méthode

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.
Résultat object

ReadShort() public static méthode

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.
Résultat short

ReadString() public static méthode

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.
Résultat string

ReadSymbol() public static méthode

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.
Résultat Amqp.Types.Symbol

ReadTimestamp() public static méthode

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.
Résultat System.DateTime

ReadUByte() public static méthode

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.
Résultat byte

ReadUInt() public static méthode

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.
Résultat uint

ReadULong() public static méthode

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.
Résultat ulong

ReadUShort() public static méthode

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.
Résultat ushort

ReadUuid() public static méthode

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.
Résultat System.Guid

TimestampToDateTime() public static méthode

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.
Résultat System.DateTime

WriteArray() public static méthode

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.
Résultat void

WriteBinary() public static méthode

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.
Résultat void

WriteBoolean() public static méthode

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.
Résultat void

WriteByte() public static méthode

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.
Résultat void

WriteChar() public static méthode

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.
Résultat void

WriteDouble() public static méthode

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.
Résultat void

WriteFloat() public static méthode

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.
Résultat void

WriteInt() public static méthode

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.
Résultat void

WriteList() public static méthode

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.
Résultat void

WriteLong() public static méthode

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.
Résultat void

WriteMap() public static méthode

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.
Résultat void

WriteObject() public static méthode

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.
Résultat void

WriteShort() public static méthode

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.
Résultat void

WriteString() public static méthode

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.
Résultat void

WriteSymbol() public static méthode

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.
Résultat void

WriteTimestamp() public static méthode

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.
Résultat void

WriteUByte() public static méthode

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.
Résultat void

WriteUInt() public static méthode

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.
Résultat void

WriteULong() public static méthode

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.
Résultat void

WriteUShort() public static méthode

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.
Résultat void

WriteUuid() public static méthode

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.
Résultat void