Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Queue Storage Message Size

From this Windows Azure MSDN thread, I understand that the queue message size should be 8KB. We can calculate the message size by 6144 byte * 4/3 (base64 encoding).

We are storing message as XML messages (string).

How to calculate the byte size from string in C#?

like image 456
Nil Pun Avatar asked Mar 16 '26 19:03

Nil Pun


1 Answers

The byte size of a string is dependant on your encoding. This is how you get it for the UTF8 encoding, as example.

var byteSize = System.Text.Encoding.UTF8.GetBytes(xml).GetLength(0);
like image 158
Jaapjan Avatar answered Mar 19 '26 13:03

Jaapjan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!