We might want to ask the AMQP team to add an API for it.
Originally posted by @KrzysztofCwalina in Azure/azure-sdk-for-net#33682 (comment)
Currently, we need to either use ToStream or GetPayload to get the raw bytes for the AMQP message. ToStream returns a stream which we need to convert back into bytes. GetPayload returns a list of array segments that we would need to concatenate. Also, GetPayload is only available in hotfix, not in main. It would be good to have an API to get the raw bytes of an AMQP message directly. Similarly, it would be good to have an API that creates the message from bytes, rather than needing to convert the bytes first to a stream.
Originally posted by @KrzysztofCwalina in Azure/azure-sdk-for-net#33682 (comment)
Currently, we need to either use ToStream or GetPayload to get the raw bytes for the AMQP message. ToStream returns a stream which we need to convert back into bytes. GetPayload returns a list of array segments that we would need to concatenate. Also, GetPayload is only available in hotfix, not in main. It would be good to have an API to get the raw bytes of an AMQP message directly. Similarly, it would be good to have an API that creates the message from bytes, rather than needing to convert the bytes first to a stream.