How to convert hex string to byte in java

0 votes
123 views
asked Jul 21, 2013 in JAVA by kalpana (3,995 points)
Hi All

   How to convert hex string to byte in java?

1 Answer

0 votes
answered Jul 23, 2013 by BasicQuestion (1,355 points)

Hi

  String hex = "68656c6c6f";

byte[] bts = new BigInteger(hex, 16).toByteArray();
...