コード例 #1
0
ファイル: ArrayEncoding.cs プロジェクト: xinchen10/azure-amqp
        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);
        }
コード例 #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);
        }
コード例 #3
0
ファイル: ArrayEncoding.cs プロジェクト: xinchen10/azure-amqp
        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);
        }
コード例 #4
0
ファイル: ArrayEncoding.cs プロジェクト: xinchen10/azure-amqp
 public static void Encode <T>(T[] value, ByteBuffer buffer)
 {
     if (value == null)
     {
         AmqpEncoding.EncodeNull(buffer);
     }
     else
     {
         ArrayEncoding.Encode(value, value.Length, typeof(T), buffer);
     }
 }
コード例 #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);
     }
 }