package com.dayu.recharge.tools; /** * Copyright (C), 2022, * Author: zuo * Date: 2022/3/9 20:22 * Description:数组工具类 */ public class ArraysUtil { /** * @param base 主数组 * @param son 子数组(需要融合进主数组的数组) * @param index 从主数组什么位置开始融合(位置数从0开始) * @return */ public static byte[] copyof(byte[] base, byte[] son, int index) { try { if (index < base.length) for (int i = 0; i < son.length; i++) { base[index + i] = son[i]; } } catch (Exception e) { e.printStackTrace(); } return base; } /** * @param base 主数组 * @param son 数据 * @param index 从主数组什么位置开始融合(位置数从0开始) * @return */ public static byte[] copyof(byte[] base, byte son, int index) { base[index] = son; return base; } }