Java Hex Convert To fromHex(String s)

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

Description

from Hex

License

Open Source License

Declaration

public static byte[] fromHex(String s) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static byte[] fromHex(String s) {
        byte bs[] = new byte[s.length() / 2];
        for (int i = 0; i < bs.length; i++)
            bs[i] = (byte) Integer.parseInt(s.substring(i * 2, i * 2 + 2), 16);
        return bs;
    }/*from  w  w  w. j a va2s  . co  m*/
}

Related

  1. fromHex(String hexString)
  2. fromHex(String input, int max)
  3. fromHex(String s)
  4. fromHex(String s)
  5. fromHex(String s)
  6. fromHex(String s)
  7. fromHex(String s)
  8. fromHex(String s)
  9. fromHex(String s, boolean hexIsDefault)