0
点赞
收藏
分享

微信扫一扫

public static byte[] Unicode2Byte(String s) {

西特张 2022-08-01 阅读 70

public static byte[] Unicode2Byte(String s) {

int len = s.length();

byte abyte[] = new byte[len << 1];

int j = 0;

for (int i = 0; i < len; i++) {

char c = s.charAt(i);

abyte[j++] = (byte) (c >> 8);

abyte[j++] = (byte) (c & 0xff);

}

return abyte;

}

举报

相关推荐

0 条评论