java十六进制转为byte类型

借用Integer类型转换

byte c = Integer.valueOf("ca",16).byteValue();
byte c = (byte) Integer.parseInt("ca", 16);

直接强转

byte b = (byte)0xca;

猜你喜欢

转载自blog.csdn.net/WeiJiFeng_/article/details/81189831