private static int createRandomNum(final long numSize) throws Exception {
        Set<Integer> set = new LinkedHashSet<Integer>();
        int count = 0;
        boolean isSplit = false;
        while (count < numSize) {
            int num = (int) (Math.random() * numSize + 1);
            if (set.add(num)) {
                count++;
            }
            //拆分批量写入文件
            if (set.size() >= SPLIT_SIZE) {
                writeFile(INPUT_FILE, set, true);
                set.clear();
                isSplit = true;
            }
        }

        //从未拆分过则一次写入文件
        if (set.size() > 0 && set.size() < SPLIT_SIZE && !isSplit) {
            writeFile(INPUT_FILE, set, false);
        }
        //曾拆分过剩余部分写入文件
        else if (set.size() > 0 && set.size() < SPLIT_SIZE && isSplit) {
            writeFile(INPUT_FILE, set, true);
        }
        return count;
    }