LichongQ / record

for record something necessary
0 stars 0 forks source link

java文件读写 #15

Open LichongQ opened 6 years ago

LichongQ commented 6 years ago

https://www.cnblogs.com/lovebread/archive/2009/11/23/1609122.html http://www.runoob.com/java/java-files-io.html

File file = new File(); char[] buffer = new char[MAX]; FileInputStream in = new FileInputStream(file); StringBuilderWriter out = new StringBuilderWriter(); int n = in.read(buffer); out.write(buffer, 0, n); String s = out.toString();

LichongQ commented 5 years ago

配置文件的自动加载:https://github.com/vonzhou/Blog/blob/master/Contents/Java/%E5%8A%A8%E6%80%81%E5%8A%A0%E8%BD%BD%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E7%9A%84%E5%AE%9E%E7%8E%B0.md

  1. 使用用commons-cofiguration的ReloadingFileBasedConfigurationBuilder
  2. 使用jdk1.7的WatchService