Java 类型转换 byte long int short
摘要:/*** byte to int* * @param b* 待转换的字节数组* @param offset* 偏移量,字节数组中开始转换的位置* @return*/public static int byte2int(byte b[], int offset) { return b[offset + 3] & 0xff | (b[offset + 2] & 0xff) << 8 | (b[offset + 1] & 0xff) << 16 | (b[offset] & 0xff) << 24;}/*** int to byte
阅读全文
posted @
2011-10-14 14:01
daiqing
阅读(210)
推荐(0)