java 中byte[] 数组的合并 //System.arraycopy()方法 public static byte[] byteMerger(byte[] bt1, byte[]
java 中byte[] 数组的合并 //System.arraycopy()方法 public static byte[] byteMerger(byte[] bt1, byte[]
代码语言:javascript代码运行次数:0运行复制 //System.arraycopy()方法
public static byte[] byteMerger(byte[] bt1
java 中byte[] 数组的合并 //System.arraycopy()方法 public static byte[] byteMerger(byte[] bt1, byte[]
代码语言:javascript代码运行次数:0运行复制 //System.arraycopy()方法
public static byte[] byteMerger(byte[] bt1, byte[] bt2){
byte[] bt = new byte[bt1.length+bt2.length];
System.arraycopy(bt1, 0, bt, 0, bt1.length);
System.arraycopy(bt2, 0, bt, bt1.length, bt2.length);
return bt;
}
代码语言:javascript代码运行次数:0运行复制byte[] recvDataHead = {2,48,48,48,50,48,48,48,48,48,48,};
byte[] recvData = DataPackage.buildPkg(cmdh, cmdl, param, param_offset, param_len);
int length=recvDataHead.length+recvData.length;
byte[] recvDataFin = new byte[length];
//数组头部添加头部信息;进行数组合并。
System.arraycopy(recvDataHead, 0, recvDataFin, 0, recvDataHead.length);
System.arraycopy(recvData, 0, recvDataFin, recvDataHead.length, recvData.length);
hostMessage.setRespeMsg(recvDataFin);
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。 原始发表:2024-12-16,如有侵权请联系 cloudcommunity@tencent 删除staticsystem数组javabyte #感谢您对电脑配置推荐网 - 最新i3 i5 i7组装电脑配置单推荐报价格的认可,转载请说明来源于"电脑配置推荐网 - 最新i3 i5 i7组装电脑配置单推荐报价格
上传时间: 2025-07-28 07:27:46
推荐阅读
留言与评论(共有 5 条评论) |
本站网友 血尿 | 5分钟前 发表 |
recvData.length); hostMessage.setRespeMsg(recvDataFin);本文参与 腾讯云自媒体同步曝光计划 | |
本站网友 零和竞争 | 25分钟前 发表 |
byte[] 代码语言:javascript代码运行次数:0运行复制 //System.arraycopy()方法 public static byte[] byteMerger(byte[] bt1 | |
本站网友 荆州社区 | 21分钟前 发表 |
recvDataFin | |
本站网友 万东医疗招聘 | 18分钟前 发表 |
原始发表:2024-12-16 |