public static void main(String[] args) {
String result = "7E5500010000001F3000080000010000000000003D9D";
if (result.length() > 24) {
String low = result.substring(20, 22);
String high = result.substring(22, 24);
int length = 24 + Integer.parseInt(high + low, 16) * 2 + 4;
System.out.println("低级写法"+length);
System.out.println("----------------------");
length = 24 + (Integer.parseInt(result.substring(20, 24), 16) >> 8) * 2 + 4;
System.out.println("高级写法"+length);
}
/**
* 0008--->000000001000-->8
* 0800--->100000000000-->2048
*/
int i = Integer.parseInt("0800", 16) >> 8;
System.out.println(i);
System.out.println(i << 8);
System.out.println(Integer.toHexString(i << 8));
}