Java Hex Convert To fromHexString(String value)

Here you can find the source of fromHexString(String value)

Description

from Hex String

License

LGPL

Declaration

public static byte[] fromHexString(String value) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

public class Main {

    public static byte[] fromHexString(String value) {
        byte[] rs = new byte[value.length() / 2];
        for (int i = 0; i < value.length(); i += 2) {
            String b = value.substring(i, i + 2);
            rs[i / 2] = Integer.valueOf(b, 16).byteValue();
        }//from ww w  .j a v a 2  s. co  m
        return rs;
    }
}

Related

  1. fromHexString(String s)
  2. fromHexString(String s)
  3. fromHexString(String s, int offset, int length)
  4. fromHexString(String str)
  5. fromHexString(String text)
  6. fromHexToBytes(String hex)