byte array encoded into a string
My application sends a byte array such as [0, 0, 0, 0, 0, 0, -61, 81] that is converted from a long type of value such as 50001 to client. I used the following code to convert a byte array to a string
new String(data, 0, data.length, "UTF-8") where data is byte[] such as [0, 0, 0, 0, 0, 0, -61, 81]
The final string is not 50001. I also test it in a standalone application. I got the same result.
Please help me.
David
-- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home