Android Hex String to Byte Array Convert toByte(String hexString)

Here you can find the source of toByte(String hexString)

Description

to Byte

Declaration

public static byte[] toByte(String hexString) 

Method Source Code

//package com.java2s;

public class Main {
    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;
    }//w w  w.ja v  a  2s  . co  m
}

Related

  1. hexStringToByteArray(String s)
  2. hexStringToBytes(String hex)
  3. hexStringToBytes(String hex)
  4. hexStringToBytes(String hexString)
  5. hexStringToBytes(String hexString)
  6. toByte(String hexString)
  7. hex2byte(String inputString)
  8. fromHex(String hex)
  9. fromHex(String hex)