https://img2020.cnblogs.com/blog/1101843/202010/1101843-20201029092119794-1182278230.jpg

支付宝

https://img2020.cnblogs.com/blog/1101843/202010/1101843-20201029091740174-1560674849.png

微 信

同步和异步

打电话和发短信

 

Java 7 引入了java.nio包下的Files,大大简化了文件的读写,如下:

// 写入文件(追加方式:StandardOpenOption.APPEND)
Files.write(Paths.get(filePath), Content.getBytes(StandardCharsets.UTF_8), StandardOpenOption.APPEND);

// 读取文件
byte[] data = Files.readAllBytes(Paths.get(filePath));
System.out.println(new String(data, StandardCharsets.UTF_8));

 

// 创建多(单)层目录(如果不存在创建,存在不会报错)
new File("D://a//b").mkdirs();

 

posted @ 2017-06-08 21:26  huangwanlin  阅读(507)  评论(0编辑  收藏  举报
Copyright 2012-2021 林云希科技有限责任公司