Beispiel #1
0
        internal static void Encode(IList value, int count, Type itemType, ByteBuffer buffer)
        {
            int width;
            int encodeSize = ArrayEncoding.GetEncodeSize(value, count, itemType, false, out width);

            AmqpBitConverter.WriteUByte(buffer, width == FixedWidth.UByte ? FormatCode.Array8 : FormatCode.Array32);
            ArrayEncoding.Encode(value, count, itemType, width, encodeSize, buffer);
        }
Beispiel #2
0
        public override void EncodeObject(object value, bool arrayEncoding, ByteBuffer buffer)
        {
            Array array = (Array)value;
            int   width;
            int   encodeSize = ArrayEncoding.GetEncodeSize(array, arrayEncoding, out width);

            AmqpBitConverter.WriteUByte(buffer, width == FixedWidth.UByte ? FormatCode.Array8 : FormatCode.Array32);
            ArrayEncoding.Encode(array, width, encodeSize, buffer);
        }
Beispiel #3
0
        public override void EncodeObject(object value, bool arrayEncoding, ByteBuffer buffer)
        {
            IList array    = (IList)value;
            Type  itemType = array.Count > 0 ? array[0].GetType() : null;
            int   width;
            int   encodeSize = ArrayEncoding.GetEncodeSize(array, array.Count, itemType, arrayEncoding, out width);

            AmqpBitConverter.WriteUByte(buffer, width == FixedWidth.UByte ? FormatCode.Array8 : FormatCode.Array32);
            ArrayEncoding.Encode(array, array.Count, itemType, width, encodeSize, buffer);
        }
Beispiel #4
0
 public static void Encode <T>(T[] value, ByteBuffer buffer)
 {
     if (value == null)
     {
         AmqpEncoding.EncodeNull(buffer);
     }
     else
     {
         ArrayEncoding.Encode(value, value.Length, typeof(T), buffer);
     }
 }
Beispiel #5
0
 public static void Encode <T>(T[] value, ByteBuffer buffer)
 {
     if (value == null)
     {
         AmqpEncoding.EncodeNull(buffer);
     }
     else
     {
         int width;
         int encodeSize = ArrayEncoding.GetEncodeSize(value, false, out width);
         AmqpBitConverter.WriteUByte(buffer, width == FixedWidth.UByte ? FormatCode.Array8 : FormatCode.Array32);
         ArrayEncoding.Encode(value, width, encodeSize, buffer);
     }
 }