You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Is this for usability or performance? At least the new GetBytes API would not improve performance over the ToStream method. The message serialization internally avoids creating a big buffer to hold the entire message. it is always a segmented list of byte arrays for various parts of the message. To give a single byte array (or other types) the new API would need to copy all bytes into the returned type. It is just a matter of where the bytes are copied: in the library or by the user.
The deserialization from a byte array (or something similar) is a valid request. That would save a few lines of code for the user and improve usability a little bit.
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.
The text was updated successfully, but these errors were encountered: