Here you can find the source of fromHex2B(String src)
public static int fromHex2B(String src)
//package com.java2s; public class Main { public static int fromHex2B(String src) { byte[] b = fromHex(src); int position = 0; int i = (b[position++] & 0xff); i |= (b[position++] & 0xff) << 8; return i; }//from w ww . ja v a 2s. c o m public static byte[] fromHex(String src) { String[] hex = src.split(" "); byte[] b = new byte[hex.length]; for (int i = 0; i < hex.length; i++) { b[i] = (byte) (Integer.parseInt(hex[i], 16) & 0xff); } return b; } public static String fromHex(String hexString, String charset) { try { byte[] b = fromHex(hexString); if (charset == null) { return new String(b); } return new String(b, charset); } catch (Exception e) { return null; } } }