Class AmqpBitConverter
Reads primitive values from a buffer or writes primitive values to a buffer in networking order.
Inheritance
Inherited Members
Namespace: Amqp
Assembly: Amqp.Net.dll
Syntax
public static class AmqpBitConverter
Fields
IsLittleEndian
Indicates the byte order ("endianness") in which data is stored in this computer architecture.
Declaration
public static readonly bool IsLittleEndian
Field Value
| Type | Description |
|---|---|
| System.Boolean |
Methods
ReadByte(ByteBuffer)
Reads a signed byte and advance the buffer read cursor.
Declaration
public static sbyte ReadByte(ByteBuffer buffer)
Parameters
| Type | Name | Description |
|---|---|---|
| ByteBuffer | buffer | The buffer to read from. |
Returns
| Type | Description |
|---|---|
| System.SByte |
ReadBytes(ByteBuffer, Byte[], Int32, Int32)
Reads bytes from one buffer into another.
Declaration
public static void ReadBytes(ByteBuffer buffer, byte[] data, int offset, int count)
Parameters
| Type | Name | Description |
|---|---|---|
| ByteBuffer | buffer | Source buffer. |
| System.Byte[] | data | Destination buffer |
| System.Int32 | offset | The start position to write. |
| System.Int32 | count | The number of bytes to read. |
ReadDouble(ByteBuffer)
Reads a 64-bit floating-point value from the buffer and advance the buffer read cursor.
Declaration
public static double ReadDouble(ByteBuffer buffer)
Parameters
| Type | Name | Description |
|---|---|---|
| ByteBuffer | buffer | The buffer to read from. |
Returns
| Type | Description |
|---|---|
| System.Double |
ReadFloat(ByteBuffer)
Reads a 32-bit floating-point value from the buffer and advance the buffer read cursor.
Declaration
public static float ReadFloat(ByteBuffer buffer)
Parameters
| Type | Name | Description |
|---|---|---|
| ByteBuffer | buffer | The buffer to read from. |
Returns
| Type | Description |
|---|---|
| System.Single |
ReadInt(ByteBuffer)
Reads a 32-bit signed integer and advance the buffer read cursor.
Declaration
public static int ReadInt(ByteBuffer buffer)
Parameters
| Type | Name | Description |
|---|---|---|
| ByteBuffer | buffer | The buffer to read from. |
Returns
| Type | Description |
|---|---|
| System.Int32 |
ReadInt(Byte[], Int32)
Reads a 32-bit signed integer from the buffer at the specified offset.
Declaration
public static int ReadInt(byte[] buffer, int offset)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | buffer | The buffer to read from. |
| System.Int32 | offset | The offset in the buffer to start reading. |
Returns
| Type | Description |
|---|---|
| System.Int32 |
ReadLong(ByteBuffer)
Reads a 64-bit signed integer from the buffer and advance the buffer read cursor.
Declaration
public static long ReadLong(ByteBuffer buffer)
Parameters
| Type | Name | Description |
|---|---|---|
| ByteBuffer | buffer | The buffer to read from. |
Returns
| Type | Description |
|---|---|
| System.Int64 |
ReadShort(ByteBuffer)
Reads a 16-bit signed integer and advance the buffer read cursor.
Declaration
public static short ReadShort(ByteBuffer buffer)
Parameters
| Type | Name | Description |
|---|---|---|
| ByteBuffer | buffer | The buffer to read from. |
Returns
| Type | Description |
|---|---|
| System.Int16 |
ReadUByte(ByteBuffer)
Reads an unsigned byte and advance the buffer read cursor.
Declaration
public static byte ReadUByte(ByteBuffer buffer)
Parameters
| Type | Name | Description |
|---|---|---|
| ByteBuffer | buffer | The buffer to read from. |
Returns
| Type | Description |
|---|---|
| System.Byte |
ReadUInt(ByteBuffer)
Reads a 32-bit unsigned integer and advance the buffer read cursor.
Declaration
public static uint ReadUInt(ByteBuffer buffer)
Parameters
| Type | Name | Description |
|---|---|---|
| ByteBuffer | buffer | The buffer to read from. |
Returns
| Type | Description |
|---|---|
| System.UInt32 |
ReadULong(ByteBuffer)
Reads a 64-bit unsigned integer from the buffer and advance the buffer read cursor.
Declaration
public static ulong ReadULong(ByteBuffer buffer)
Parameters
| Type | Name | Description |
|---|---|---|
| ByteBuffer | buffer | The buffer to read from. |
Returns
| Type | Description |
|---|---|
| System.UInt64 |
ReadUShort(ByteBuffer)
Reads a 16-bit unsigned integer and advance the buffer read cursor.
Declaration
public static ushort ReadUShort(ByteBuffer buffer)
Parameters
| Type | Name | Description |
|---|---|---|
| ByteBuffer | buffer | The buffer to read from. |
Returns
| Type | Description |
|---|---|
| System.UInt16 |
ReadUuid(ByteBuffer)
Reads a uuid (16-bytes) from the buffer and advance the buffer read cursor.
Declaration
public static Guid ReadUuid(ByteBuffer buffer)
Parameters
| Type | Name | Description |
|---|---|---|
| ByteBuffer | buffer | The buffer to read from. |
Returns
| Type | Description |
|---|---|
| System.Guid |
WriteByte(ByteBuffer, SByte)
Writes a signed byte into the buffer and advance the buffer write cursor.
Declaration
public static void WriteByte(ByteBuffer buffer, sbyte data)
Parameters
| Type | Name | Description |
|---|---|---|
| ByteBuffer | buffer | The buffer to write. |
| System.SByte | data | The data to write. |
WriteBytes(ByteBuffer, Byte[], Int32, Int32)
Writes bytes from one buffer into another.
Declaration
public static void WriteBytes(ByteBuffer buffer, byte[] data, int offset, int count)
Parameters
| Type | Name | Description |
|---|---|---|
| ByteBuffer | buffer | The destination buffer. |
| System.Byte[] | data | The source buffer |
| System.Int32 | offset | The position in source buffer to start. |
| System.Int32 | count | The number of bytes to write. |
WriteDouble(ByteBuffer, Double)
Writes a 64-bit floating-point value into the buffer and advance the buffer write cursor.
Declaration
public static void WriteDouble(ByteBuffer buffer, double data)
Parameters
| Type | Name | Description |
|---|---|---|
| ByteBuffer | buffer | The buffer to write. |
| System.Double | data | The data to write. |
WriteFloat(ByteBuffer, Single)
Writes a 32-bit floating-point value into the buffer and advance the buffer write cursor.
Declaration
public static void WriteFloat(ByteBuffer buffer, float data)
Parameters
| Type | Name | Description |
|---|---|---|
| ByteBuffer | buffer | The buffer to write. |
| System.Single | data | The data to write. |
WriteInt(ByteBuffer, Int32)
Writes a 32-bit signed integer into the buffer and advance the buffer write cursor.
Declaration
public static void WriteInt(ByteBuffer buffer, int data)
Parameters
| Type | Name | Description |
|---|---|---|
| ByteBuffer | buffer | The buffer to write. |
| System.Int32 | data | The data to write. |
WriteInt(Byte[], Int32, Int32)
Writes a 32-bit unsigned integer into the buffer at specified offset.
Declaration
public static void WriteInt(byte[] buffer, int offset, int data)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | buffer | The buffer to write. |
| System.Int32 | offset | The offset of the buffer. |
| System.Int32 | data | The data to write. |
WriteLong(ByteBuffer, Int64)
Writes a 64-bit signed integer into the buffer and advance the buffer write cursor.
Declaration
public static void WriteLong(ByteBuffer buffer, long data)
Parameters
| Type | Name | Description |
|---|---|---|
| ByteBuffer | buffer | The buffer to write. |
| System.Int64 | data | The data to write. |
WriteShort(ByteBuffer, Int16)
Writes a 16-bit signed integer into the buffer and advance the buffer write cursor.
Declaration
public static void WriteShort(ByteBuffer buffer, short data)
Parameters
| Type | Name | Description |
|---|---|---|
| ByteBuffer | buffer | The buffer to write. |
| System.Int16 | data | The data to write. |
WriteUByte(ByteBuffer, Byte)
Writes an unsigned byte into the buffer and advance the buffer write cursor.
Declaration
public static void WriteUByte(ByteBuffer buffer, byte data)
Parameters
| Type | Name | Description |
|---|---|---|
| ByteBuffer | buffer | The buffer to write. |
| System.Byte | data | The data to write. |
WriteUInt(ByteBuffer, UInt32)
Writes a 32-bit unsigned integer into the buffer and advance the buffer write cursor.
Declaration
public static void WriteUInt(ByteBuffer buffer, uint data)
Parameters
| Type | Name | Description |
|---|---|---|
| ByteBuffer | buffer | The buffer to write. |
| System.UInt32 | data | The data to write. |
WriteULong(ByteBuffer, UInt64)
Writes a 64-bit unsigned integer into the buffer and advance the buffer write cursor.
Declaration
public static void WriteULong(ByteBuffer buffer, ulong data)
Parameters
| Type | Name | Description |
|---|---|---|
| ByteBuffer | buffer | The buffer to write. |
| System.UInt64 | data | The data to write. |
WriteUShort(ByteBuffer, UInt16)
Writes a 16-bit unsigned integer into the buffer and advance the buffer write cursor.
Declaration
public static void WriteUShort(ByteBuffer buffer, ushort data)
Parameters
| Type | Name | Description |
|---|---|---|
| ByteBuffer | buffer | The buffer to write. |
| System.UInt16 | data | The data to write. |
WriteUuid(ByteBuffer, Guid)
Writes a uuid (16-bytes) into the buffer and advance the buffer write cursor.
Declaration
public static void WriteUuid(ByteBuffer buffer, Guid data)
Parameters
| Type | Name | Description |
|---|---|---|
| ByteBuffer | buffer | The buffer to write. |
| System.Guid | data | The data to write. |