0

I have a string which contains elements of byte array such as "[B@42b19e58" which I have to convert back into the byte array.

Can someone please suggest me a method to do so?

Here, I don't have to convert a string to byte array. I already have byte array elements in the string, I just have to put them back to the array.

1 Answers1

0

Use this code

String str= "Convert Java String";
byte[] byteArray = str.getBytes();
jitendra purohit
  • 652
  • 5
  • 18