public static void Encode(ByteBuffer buffer, MessageId messageId) { if (messageId == null) { AmqpEncoding.EncodeNull(buffer); } else { messageId.OnEncode(buffer); } }
/// <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); } }
public static int GetEncodeSize(MessageId messageId) { return(messageId == null ? FixedWidth.NullEncoded : messageId.EncodeSize); }
public static int GetEncodeSize(MessageId messageId) { return messageId == null ? FixedWidth.NullEncoded : messageId.EncodeSize; }