Android Hex String to Byte Array Convert fromHex(String hex)

Here you can find the source of fromHex(String hex)

Description

from Hex

Declaration

public static String fromHex(String hex) 

Method Source Code

//package com.java2s;

public class Main {
    public static String fromHex(String hex) {
        return new String(toByte(hex));
    }/*w ww.j  av a  2s.c om*/

    public static byte[] toByte(String hexString) {
        int len = hexString.length() / 2;
        byte[] result = new byte[len];
        for (int i = 0; i < len; i++)
            result[i] = Integer.valueOf(
                    hexString.substring(2 * i, 2 * i + 2)).byteValue();
        return result;
    }
}

Related

  1. hexStringToBytes(String hexString)
  2. hexStringToBytes(String hexString)
  3. toByte(String hexString)
  4. toByte(String hexString)
  5. hex2byte(String inputString)
  6. fromHex(String hex)
  7. hexToBytes(String str)
  8. hexToByte(String input)
  9. hexToBytes(String hexString)