Here you can find the source of hexStr2Str(String hexStr)
public static String hexStr2Str(String hexStr)
//package com.java2s; //License from project: Apache License public class Main { public static String hexStr2Str(String hexStr) { String str = "0123456789ABCDEF"; char[] hexs = hexStr.toCharArray(); byte[] bytes = new byte[hexStr.length() / 2]; int n;//from w w w.ja va 2 s . c o m for (int i = 0; i < bytes.length; i++) { n = str.indexOf(hexs[2 * i]) * 16; n += str.indexOf(hexs[2 * i + 1]); bytes[i] = (byte) (n & 0xff); } return new String(bytes); } }