static void ReadAmqpValueSection(AmqpMessageReader reader, AmqpMessage message) { ArraySegment <byte> buffer = reader.ReadBytes(int.MaxValue); ByteBuffer byteBuffer = ByteBuffer.Wrap(buffer); object value = AmqpCodec.DecodeObject(byteBuffer); reader.amqpValue = new AmqpValue() { Value = value }; reader.AddBodyBuffer(buffer); // we didn't know the size and the buffer may include the footer if (byteBuffer.Length > 0) { Footer footer = new Footer(); footer.Decode(byteBuffer); message.Footer = footer; } }