Wednesday, May 16, 2012

Need to help to convert string to hex bytes

I am programming in Java. The program have a String as below.



String str = "byte."


Can the above string be converted to an array of hex bytes as below?



byte[] data = {0x62, 0x79, 0x74, 0x65};


Thank you.





No comments:

Post a Comment