0

I have parsed a txt file and as a result I have now a String str = "33 00 9D F2 C9 59 02 0A 00 00 CB 08 01 01 03 01 43 97 B1 02 9D F2 C9 59 1C 01 04 00 10 00 00 16 03 80 05 00 19 00 00 00 4D 00 06 00 45 00 5A A0 47 3E A7 04 D5 08 00 00 00"

now I do str.split(" ") which gives me a String[] containing each of those values from the string. How can I translate each of those 2 char strings to bytes without changing their values?

So basically how to do String[] = {"33", "00", "9D"....} -> byte[] = {33, 00, 9D}?

2
  • This answer should fit to your problem stackoverflow.com/a/8652958 Commented Oct 2, 2017 at 10:25
  • In this case you can simply try str_arr[i].getBytes() Commented Oct 2, 2017 at 10:26

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.