Exemple #1
0
 public static int GetEncodeSize(AmqpMap value)
 {
     if (value == null)
     {
         return(1);
     }
     return(1 + MapEncoding.GetEncodeWidth(value) * 2 + value.ValueSize);
 }
Exemple #2
0
        public static void Encode(AmqpMap value, ByteBuffer buffer)
        {
            if (value == null)
            {
                AmqpEncoding.EncodeNull(buffer);
                return;
            }
            int encodeWidth = MapEncoding.GetEncodeWidth(value);

            AmqpBitConverter.WriteUByte(buffer, (byte)((encodeWidth == 1 ? 193 : 209)));
            int valueSize = encodeWidth + value.ValueSize;

            MapEncoding.Encode(value, encodeWidth, valueSize, buffer);
        }
Exemple #3
0
        public static void Encode(AmqpMap value, ByteBuffer buffer)
        {
            if (value == null)
            {
                AmqpEncoding.EncodeNull(buffer);
            }
            else
            {
                int encodeWidth = MapEncoding.GetEncodeWidth(value);
                AmqpBitConverter.WriteUByte(buffer, encodeWidth == FixedWidth.UByte ? (byte)FormatCode.Map8 : (byte)FormatCode.Map32);

                int size = encodeWidth + value.ValueSize;
                MapEncoding.Encode(value, encodeWidth, size, buffer);
            }
        }
Exemple #4
0
 public static int GetEncodeSize(AmqpMap value)
 {
     return(value == null ?
            FixedWidth.NullEncoded :
            FixedWidth.FormatCode + (MapEncoding.GetEncodeWidth(value) * 2) + value.ValueSize);
 }