All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.aliyun.kms.kms20160120.utils.ArrayUtils Maven / Gradle / Ivy

Go to download

Alibaba Cloud KMS SDK for Java Copyright (C) Alibaba Cloud Computing All rights reserved. 版权所有 (C)阿里云计算有限公司 http://www.aliyun.com

The newest version!
package com.aliyun.kms.kms20160120.utils;

import java.util.Arrays;

public class ArrayUtils {
    private ArrayUtils() {
    }

    public static byte[] concatAll(byte[] first, byte[]... rest) {
        int totalLength = first.length;
        for (int index = 0; index < rest.length; ++index) {
            totalLength += rest[index].length;
        }

        byte[] result = Arrays.copyOf(first, totalLength);
        for (int index = 0, offset = first.length; index < rest.length; ++index) {
            byte[] array = rest[index];
            System.arraycopy(array, 0, result, offset, array.length);
            offset += array.length;
        }

        return result;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy