java合并两个byte数组为一个

 public static byte[] byteMerge(byte[] bt1, byte[] bt2) {
        byte[] bt3 = new byte[bt1.length + bt2.length];
        System.arraycopy(bt1, 0, bt3, 0, bt1.length);
        System.arraycopy(bt2, 0, bt3, bt1.length, bt2.length);
        return bt3;
    }

 

posted @ 2022-04-29 16:21  bert_qin  阅读(726)  评论(0编辑  收藏  举报