public static String byte2Unicode(byte by[]) {
return byte2Unicode(by, 0, by.length);
}
public static String byte2Unicode(byte[] src, int start, int len) {
if (start + len > src.length || len % 2 != 0) {
throw new IllegalArgumentException();
}
StringBuffer sb = new StringBuffer();
char ch;
int i;
for (i = start; i < start + (len / 2); i++) {
ch = (char) ((src[start + (i - start) * 2] << 8) | (src[start
+ (i - start) * 2 + 1] & 0xff));
sb.append(ch);
}
return sb.toString();
}