String hexshort = "ff9b";
BigInteger bigint=new BigInteger(hexshort, 16);
short short1 = bigint.shortValue();//单字
String hexint = "ffffff9b";
BigInteger bigint=new BigInteger(hexint, 16);
int int1 = bigint.intValue();//双字
String hexbyte = "9b";
BigInteger bigint=new BigInteger(hexbyte, 16);
byte byte1 = bigint.byteValue();//单字节
java关于单字、双字、单字节16进制转10进制的简单方法(包含负数)
最新推荐文章于 2024-07-18 19:40:28 发布