Java把数组分割成若干个字数组

        //大数据分割成若干个小数组
        //每个小数组10000个数字
        Integer chunkSize = 10000;
        //分割的任务数量
        Integer sendTimes = (int) Math.ceil(mobileArray.length / chunkSize.floatValue());
        log.info("分割数:", sendTimes);
        for (int i = 0; i < sendTimes; i++) {
            int start = i * chunkSize;
            int length = Math.min(mobileArray.length - start, chunkSize);
            String[] arrayStr = Arrays.copyOfRange(mobileArray, start, start + length);
            String context = String.join(",", arrayStr);
        }

你可能感兴趣的:(java)