Java Question: Converting Hex String to byte Array when you don't know how many bytes are in the array?

I am interested in converting a Hex String to a byte Array, and having a method that will always work even if the size of the byte array needed isn't known.

There's a great answer if I want/need it to be only 4 bytes long -- but I want to understand better how to put that into a loop.

Who is Participating?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.