예제 #1
0
 public override void EncodeObject(object value, bool arrayEncoding, ByteBuffer buffer)
 {
     if (arrayEncoding)
     {
         AmqpBitConverter.WriteUByte(buffer, (byte)value);
     }
     else
     {
         UByteEncoding.Encode((byte)value, buffer);
     }
 }
예제 #2
0
 public override int GetObjectEncodeSize(object value, bool arrayEncoding)
 {
     if (arrayEncoding)
     {
         return(FixedWidth.UByte);
     }
     else
     {
         return(UByteEncoding.GetEncodeSize((byte)value));
     }
 }
예제 #3
0
 /// <summary>
 /// Decodes an 8-bit unsigned integer from the buffer and advances the buffer's position.
 /// </summary>
 /// <param name="buffer">The buffer to read.</param>
 /// <returns>An 8-bit unsigned integer.</returns>
 public static byte?DecodeUByte(ByteBuffer buffer)
 {
     return(UByteEncoding.Decode(buffer, 0));
 }
예제 #4
0
 /// <summary>
 /// Encodes an 8-bit unsigned integer and appends the bytes to the buffer.
 /// </summary>
 /// <param name="data">The 8-bit unsigned integer.</param>
 /// <param name="buffer">The destination buffer.</param>
 public static void EncodeUByte(byte?data, ByteBuffer buffer)
 {
     UByteEncoding.Encode(data, buffer);
 }
예제 #5
0
 /// <summary>
 /// Gets the encode size of an 8-bit unsigned integer.
 /// </summary>
 /// <param name="value">The 8-bit unsigned integer.</param>
 /// <returns>Encode size in bytes of the 8-bit unsigned integer.</returns>
 public static int GetUByteEncodeSize(byte?value)
 {
     return(UByteEncoding.GetEncodeSize(value));
 }
예제 #6
0
 public override object DecodeObject(ByteBuffer buffer, FormatCode formatCode)
 {
     return(UByteEncoding.Decode(buffer, formatCode));
 }