Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Hex string to ASCII

807580Sep 24 2009 — edited Sep 28 2009
I have a hex string...

String commandOff = "02 62 11 3F FE 05 11 00";

I'm trying to convert this string to ASCII to send via telnet to an Insteon device. I thought I could do...

int bytes = Integer.parseInt(commandOff.replace(" ", ""), 16);

to conver to ASCII but I get a number format exception. How can I convert this hes string to ASCII?

Any help is appreciated.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 26 2009
Added on Sep 24 2009
16 comments
1,208 views