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

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

Description

to Byte

Declaration

private static byte[] toByte(String hexString) 

Method Source Code

//package com.java2s;

public class Main {
    private 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), 16).byteValue();
        return result;
    }/*from w  ww. ja  v a  2s  .  c o  m*/
}

Related

  1. hex2bytes(String hex)
  2. hexStr2ByteArr(String paramString)
  3. hexStr2ByteArr(String str)
  4. hexStr2Bytes(String src)
  5. hexStr2Str(String hexStr)
  6. toBytesFromHexString(String digits)
  7. hexStringToBytes(String s)
  8. hexStringToBytes(String s)
  9. decodeHex(String str)