话不多说,如标题所述,直接上代码:
public static short heightLowToDec(String hex){
short height = (short)(((byte) Integer.parseInt(hex.substring(0,2), 16)) & 0xff);
short low = (short)(((byte) Integer.parseInt(hex.substring(2, 4), 16)) & 0xff);
height <<= 8; //高位左移8位
short dec = (short)(low | height);
return dec;
}