当前位置: 首页 > news >正文

手机制作表白网站二手书网站建设的意义

手机制作表白网站,二手书网站建设的意义,网站建设面试对策,微信营销的优势目录 1 需求2 实现 1 需求 我现在有一个300MB 的文件#xff0c;想要根据这个文件#xff0c;创建100万个大小一样的#xff0c;名称不一样#xff0c;如何实现#xff0c;如何比较快点实现 2 实现 1 先准备好这个文件 2 准备好目录 3 写代码 private static void crea… 目录 1 需求2 实现 1 需求 我现在有一个300MB 的文件想要根据这个文件创建100万个大小一样的名称不一样如何实现如何比较快点实现 2 实现 1 先准备好这个文件 2 准备好目录 3 写代码 private static void createFile(String sourceFilePath,String destinationFolderPath, int fileNumber) {File file1 new File(sourceFilePath);Path sourcePath Paths.get(sourceFilePath);String destinationFileName copy_ UUID.randomUUID().toString() _ file1.getName();Path destinationPath Paths.get(destinationFolderPath, destinationFileName);//try {// 复制源文件到目标文件Files.copy(sourcePath, destinationPath, StandardCopyOption.REPLACE_EXISTING);} catch (IOException e) {e.printStackTrace();}}public static void main(String[] args) {String sourceFilePath D:\\100w\\source\\1111111111111.HDF; // 替换为实际的源文件路径String destinationFolderPath D:\\100w\\dest; // 替换为实际的目标文件夹路径int numFiles 1000000; // 需要创建的文件数量int numThreads Runtime.getRuntime().availableProcessors(); // 使用可用的处理器核心数作为线程数ExecutorService executorService Executors.newFixedThreadPool(numThreads);try {// 创建目标文件夹如果不存在Files.createDirectories(Paths.get(destinationFolderPath));// 循环提交文件创建任务给线程池for (int i 100; i numFiles; i) {int fileNumber i;executorService.submit(() - createFile(sourceFilePath,destinationFolderPath, fileNumber));}executorService.shutdown();} catch (IOException e) {e.printStackTrace();}// try {// // 获取源文件的路径对象// Path sourcePath Paths.get(sourceFilePath);//// // 创建目标文件夹如果不存在// Files.createDirectories(Paths.get(destinationFolderPath));//// // 循环复制文件并创建副本文件// for (int i 0; i numFiles; i) {// // 构造目标文件的路径对象// String destinationFileName copy_ i _ sourcePath.getFileName();// Path destinationPath Paths.get(destinationFolderPath, destinationFileName);//// // 复制源文件到目标文件// Files.copy(sourcePath, destinationPath, StandardCopyOption.REPLACE_EXISTING);// }//// System.out.println(文件复制完成);// } catch (IOException e) {// e.printStackTrace();// }}
http://www.w-s-a.com/news/412713/

相关文章:

  • 举报非法网站要求做笔录wordpress怎么插视频
  • 网站服务器防护如何搭建网站平台
  • 设计师接私活的网站如何做网站的搜索栏
  • ps做图下载网站网站子目录设计
  • 厦门网站制作策划高中生做网站网页
  • 高端品牌网站建设在哪济南兴田德润优惠吗专业定制网站开发公司
  • 怎么做网站卖东西汽车网站排行榜前十名
  • 网站关键字没有排名只有单页面的网站怎么做seo
  • 网站流量盈利模式宝塔没有域名直接做网站怎么弄
  • 淡蓝色网站qq推广中心
  • 设计网站价格餐饮吸引客流的活动方案
  • 手机网站建设电话百度搜索量
  • 条件查询 php网站源码中国白云手机网站建设
  • 网上注册公司流程及材料班级优化大师免费下载电脑版
  • 应用网站如何做营销型网站的重要特点
  • 怎么样百度搜到自己的网站加强社区网站建设
  • 建设网站所需技术wordpress延时加载js
  • 网站建设沈阳搜云seo
  • 怎么申请免费的网站空间微信公众平台注册收费吗
  • 东营网站搭建最基本的网站设计
  • 网站建设技术的发展最近的国际新闻大事
  • 德州有名的网站建设公司网站如何做引流
  • 建设一个收入支出持平的网站网络推广计划书格式
  • 什么是网站黑链全球新冠疫苗接种率
  • 网站开发 chrome gimp网站不备案做seo没用
  • 织梦校园招生网站源码沪佳哪个好
  • 建设企业网站可信度软件产品如何做网站推广
  • 网站建设企业号助手贵阳景观设计公司
  • 网站开发第三方建设银行个人网站显示不了
  • 无锡兼职做网站郑州网站建设搜索优化