Exemplo n.º 1
0
 public static void Encode(ByteBuffer buffer, MessageId messageId)
 {
     if (messageId == null)
     {
         AmqpEncoding.EncodeNull(buffer);
     }
     else
     {
         messageId.OnEncode(buffer);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Decodes the fields from the buffer.
        /// </summary>
        /// <param name="buffer">The buffer.</param>
        /// <param name="count">The number of fields.</param>
        protected override void OnDecode(ByteBuffer buffer, int count)
        {
            if (count-- > 0)
            {
                this.MessageId = MessageId.Decode(buffer);
            }

            if (count-- > 0)
            {
                this.UserId = AmqpCodec.DecodeBinary(buffer);
            }

            if (count-- > 0)
            {
                this.To = Address.Decode(buffer);
            }

            if (count-- > 0)
            {
                this.Subject = AmqpCodec.DecodeString(buffer);
            }

            if (count-- > 0)
            {
                this.ReplyTo = Address.Decode(buffer);
            }

            if (count-- > 0)
            {
                this.CorrelationId = MessageId.Decode(buffer);
            }

            if (count-- > 0)
            {
                this.ContentType = AmqpCodec.DecodeSymbol(buffer);
            }

            if (count-- > 0)
            {
                this.ContentEncoding = AmqpCodec.DecodeSymbol(buffer);
            }

            if (count-- > 0)
            {
                this.AbsoluteExpiryTime = AmqpCodec.DecodeTimeStamp(buffer);
            }

            if (count-- > 0)
            {
                this.CreationTime = AmqpCodec.DecodeTimeStamp(buffer);
            }

            if (count-- > 0)
            {
                this.GroupId = AmqpCodec.DecodeString(buffer);
            }

            if (count-- > 0)
            {
                this.GroupSequence = AmqpCodec.DecodeUInt(buffer);
            }

            if (count-- > 0)
            {
                this.ReplyToGroupId = AmqpCodec.DecodeString(buffer);
            }
        }
Exemplo n.º 3
0
 public static int GetEncodeSize(MessageId messageId)
 {
     return(messageId == null ? FixedWidth.NullEncoded : messageId.EncodeSize);
 }
Exemplo n.º 4
0
 public static int GetEncodeSize(MessageId messageId)
 {
     return messageId == null ? FixedWidth.NullEncoded : messageId.EncodeSize;
 }