String.length(). However it will depend on the encoding you're using what the actual number of bytes is (that get written to a stream).
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
rini john
Greenhorn
Joined: Mar 13, 2011
Posts: 7
posted
0
In our application we want process a message which is a string but application can not process message which are more than 32 KB size.So for this we need to check the size of the message.
rini john wrote:In our application we want process a message which is a string but application can not process message which are more than 32 KB size.So for this we need to check the size of the message.
may be what you need. I would suggest that you use "utf-8" for the encoding but depending on the language you are processing you may find another encoding gives you a shorter resulting set of bytes.