标签:style blog color java for sp div c log
public static int byte2Int(byte[] b, int begin, int len) { int sum = 0; int end = begin + len; int n; for (int i = begin; i < end; i++) { n = ((int) b[i]) & 0xff; n <<= (--len) * 8; sum = n + sum; } return sum; } public static byte[] int2byte(int val, int len) { byte[] b = new byte[len]; for (int i = 0; i < len; i++) { b[len - i - 1] = (byte) ((val >> 8 * i) & 0xff); } return b; }
标签:style blog color java for sp div c log
原文地址:http://www.cnblogs.com/alvez/p/4005456.html