http://www.cnblogs.com/mstk/p/5579841.html
1. 字节转10进制
直接使用(int)类型转换。
/* * 字节转10进制 */ public static int byte2Int(byte b){ int r = (int) b; return r; }
2. 10进制转字节
直接使用(byte)类型转换。
/* * 10进制转字节 */ public static byte int2Byte(int i){ byte r = (byte) i; return r; }