Example #1
0
 void EncodeSection(ByteBuffer buffer, IAmqpSerializable section)
 {
     if (section != null)
     {
         section.Encode(buffer);
     }
 }
        /// <summary>
        /// Sends a serializable object. The buffer is initialized by the
        /// <see cref="IAmqpSerializable.Encode(ByteBuffer)"/> method.
        /// </summary>
        /// <param name="dataBlock">The serializable object.</param>
        public void SendDatablock(IAmqpSerializable dataBlock)
        {
            ByteBuffer buffer = new ByteBuffer(dataBlock.EncodeSize, true);

            dataBlock.Encode(buffer);
            this.asyncIO.WriteBuffer(buffer);
        }
Example #3
0
        public void SendDatablock(IAmqpSerializable dataBlock)
        {
            ByteBuffer buffer = new ByteBuffer(new byte[dataBlock.EncodeSize]);
            dataBlock.Encode(buffer);

            int size = buffer.Length;
            this.asyncIO.WriteBuffer(buffer);
        }
Example #4
0
 public static void EncodeSerializable(IAmqpSerializable data, ByteBuffer buffer)
 {
     if (data == null)
     {
         AmqpEncoding.EncodeNull(buffer);
         return;
     }
     data.Encode(buffer);
 }
Example #5
0
        public void SendDatablock(IAmqpSerializable dataBlock)
        {
            ByteBuffer buffer = new ByteBuffer(new byte[dataBlock.EncodeSize]);

            dataBlock.Encode(buffer);

            int size = buffer.Length;

            this.asyncIO.WriteBuffer(buffer);
        }
Example #6
0
        public override void EncodeValue(ByteBuffer buffer)
        {
            IAmqpSerializable value = base.Value as IAmqpSerializable;

            if (value != null)
            {
                value.Encode(buffer);
                return;
            }
            base.EncodeValue(buffer);
        }
Example #7
0
        public override void EncodeValue(ByteBuffer buffer)
        {
            IAmqpSerializable amqpSerializable = this.Value as IAmqpSerializable;

            if (amqpSerializable != null)
            {
                amqpSerializable.Encode(buffer);
            }
            else
            {
                base.EncodeValue(buffer);
            }
        }
Example #8
0
        public static void EncodeObject(object value, ByteBuffer buffer)
        {
            if (value == null)
            {
                AmqpEncoding.EncodeNull(buffer);
                return;
            }
            IAmqpSerializable amqpSerializable = value as IAmqpSerializable;

            if (amqpSerializable != null)
            {
                amqpSerializable.Encode(buffer);
                return;
            }
            AmqpEncoding.GetEncoding(value).EncodeObject(value, false, buffer);
        }
Example #9
0
        public static void EncodeObject(object value, ByteBuffer buffer)
        {
            if (value == null)
            {
                EncodeNull(buffer);
                return;
            }

            IAmqpSerializable serializable = value as IAmqpSerializable;

            if (serializable != null)
            {
                serializable.Encode(buffer);
                return;
            }

            EncodingBase encoding = GetEncoding(value);

            encoding.EncodeObject(value, false, buffer);
        }