Java Byte Create toByte(String hexString)

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

Description

to Byte

License

Open Source License

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), 16).byteValue();
        return result;
    }/*from www . j av  a2  s .c o  m*/
}

Related

  1. toByte(short value, boolean first)
  2. toByte(String hex)
  3. toByte(String hex)
  4. toByte(String hex)
  5. toByte(String hexStr)
  6. toByte(String str)
  7. toByte(String string)
  8. toByte(String string)
  9. toByte(String string)