1。 store 函数
String proFileName = dir + File.separator + "TOSconfig.properties";
InputStream in = new BufferedInputStream(new FileInputStream(
proFileName));
p.load(in);
p.setProperty(processName, num);
p.store(new FileOutputStream(proFileName),
"TOSproperties by lqt. Automatically generated, do not manually modify.");
store(OutputStream os, String description)
description参数就是出现在properties文件的最上面的注释。
例如上面的代码,对应下面的图片

2。
本文介绍如何使用Java进行Properties文件的读取与写入操作。通过示例代码详细展示了store函数的应用,包括设置描述参数以生成文件头部注释的方法。
206

被折叠的 条评论
为什么被折叠?



