Java Utililty Methods Hex to Byte Array

List of utility methods to do Hex to Byte Array

Description

The list of methods to do Hex to Byte Array are organized into topic(s).

Method

byte[]convertHexToBytes(String s)
Convert a hex encoded string to a byte array.
int len = s.length();
if (len % 2 != 0) {
    throw new IllegalArgumentException(s);
len /= 2;
byte[] buff = new byte[len];
for (int i = 0; i < len; i++) {
    buff[i] = (byte) ((getHexDigit(s, i + i) << 4) | getHexDigit(s, i + i + 1));
...