Example #1
0
 public override void EncodeObject(object value, bool arrayEncoding, ByteBuffer buffer)
 {
     if (arrayEncoding)
     {
         AmqpBitConverter.WriteUInt(buffer, (uint)value);
     }
     else
     {
         UIntEncoding.Encode((uint)value, buffer);
     }
 }
Example #2
0
 public override int GetObjectEncodeSize(object value, bool arrayEncoding)
 {
     if (arrayEncoding)
     {
         return(FixedWidth.UInt);
     }
     else
     {
         return(UIntEncoding.GetEncodeSize((uint)value));
     }
 }
Example #3
0
 /// <summary>
 /// Decodes a 32-bit unsigned integer from the buffer and advances the buffer's position.
 /// </summary>
 /// <param name="buffer">The buffer to read.</param>
 /// <returns>A 32-bit unsigned integer.</returns>
 public static uint?DecodeUInt(ByteBuffer buffer)
 {
     return(UIntEncoding.Decode(buffer, 0));
 }
Example #4
0
 /// <summary>
 /// Encodes a 32-bit unsigned integer and appends the bytes to the buffer.
 /// </summary>
 /// <param name="data">The 32-bit unsigned integer.</param>
 /// <param name="buffer">The destination buffer.</param>
 public static void EncodeUInt(uint?data, ByteBuffer buffer)
 {
     UIntEncoding.Encode(data, buffer);
 }
Example #5
0
 /// <summary>
 /// Gets the encode size of a 32-bit unsigned integer.
 /// </summary>
 /// <param name="value">The 32-bit unsigned integer.</param>
 /// <returns>Encode size in bytes of the 32-bit unsigned integer.</returns>
 public static int GetUIntEncodeSize(uint?value)
 {
     return(UIntEncoding.GetEncodeSize(value));
 }
Example #6
0
 public override object DecodeObject(ByteBuffer buffer, FormatCode formatCode)
 {
     return(UIntEncoding.Decode(buffer, formatCode));
 }