public override int GetObjectEncodeSize(object value, bool arrayEncoding)
        {
            IList array    = (IList)value;
            Type  itemType = array.Count > 0 ? array[0].GetType() : null;

            return(ArrayEncoding.GetEncodeSize(array, array.Count, itemType, arrayEncoding, out _));
        }
        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);
        }
Exemple #3
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);
        }
        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);
        }
Exemple #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);
     }
 }
 public static int GetEncodeSize <T>(T[] value)
 {
     return(value == null ?
            FixedWidth.NullEncoded :
            ArrayEncoding.GetEncodeSize(value, value.Length, typeof(T), false, out _));
 }
Exemple #7
0
 public override int GetObjectEncodeSize(object value, bool arrayEncoding)
 {
     return(ArrayEncoding.GetEncodeSize((Array)value, arrayEncoding));
 }
Exemple #8
0
        static int GetEncodeSize(Array array, bool arrayEncoding)
        {
            int unused;

            return(ArrayEncoding.GetEncodeSize(array, arrayEncoding, out unused));
        }
Exemple #9
0
 public static int GetEncodeSize <T>(T[] value)
 {
     return(value == null ? FixedWidth.NullEncoded : ArrayEncoding.GetEncodeSize(value, false));
 }