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!

byte array to string

897874Dec 20 2011 — edited Dec 21 2011
Hello,

can anyone suggest me how to convert byte array to string? This method does not work:
byte [] my_array=....;
String my_string = new String (my_array);
or
String my_string = my_array.toString();

What I want to do is to convert signature to string and pass it to so other side. But when I use method above and method then my_string.getBytes() signature changes and then fails to verify.

I mean for example my_string changes when I do my_string.getBytes().toString()
or my_array changes after (new String(my_array)).getBytes()

Thanks.

Edited by: 894871 on Dec 20, 2011 6:27 AM

Edited by: 894871 on Dec 20, 2011 6:34 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 18 2012
Added on Dec 20 2011
7 comments
670 views