代码实例 |
String str1="G:" + File.separator + "string.txt"; File file = new File(str1); InputStream is = new FileInputStream(file); Mapx<String, String> map = PropertiesUtil.read(is);
|
read(File f) :Mapx<String , String>
读取文件中的所有属性值。
代码实例 |
String str2="G:" + File.separator + "string_1.txt"; File file_1 = new File(str2); Mapx<String, String> map_1 = PropertiesUtil.read(file_1);
|
write(File f , Mapx<String, String> map)
将属性值写入文件。
代码实例(属性是由read(InputStream is)方法中得到的) |
String str2="G:" + File.separator + "string_1.txt"; File file_1 = new File(str2); PropertiesUtil.write(file_1, map);
|
write(OutputStream os , Mapx<String, String> map)
将属性值写入流。
代码实例 |
String str3="G:" + File.separator + "string_2.txt"; File file_2 = new File(str3);// 将Mapx类型的属性对写入流中 OutputStream os = new FileOutputStream(file_2); PropertiesUtil.write(os, map); |
所有评论仅代表网友意见