属性文件字符串长度限制(JAVA)
发布时间:2020-12-15 05:22:05 所属栏目:Java 来源:网络整理
导读:玩一个属性文件,我认为似乎有 限制40char保存在单个属性中. 我做以下事情: File configFile = new File("config.properties");Properties props = new Properties();props.put( "cc_server","sort_of_a_long_string_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
玩一个属性文件,我认为似乎有
限制40char保存在单个属性中. 我做以下事情: File configFile = new File("config.properties");
Properties props = new Properties();
props.put( "cc_server","sort_of_a_long_string_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
FileOutputStream fos = new FileOutputStream( configFile );
PrintWriter pw = new PrintWriter( fos );
props.list( pw );
pw.flush();
pw.close();
System.out.println("done.");
结果是,只有第一个37char被保存,扩展为“…”. 有没有办法扩展/关闭此限制? TIA K 解决方法
没有这样的限制
既然你提到“……”我有这个问题:你在JLabel中显示价值吗? 还有一种更简单的方法来保存属性 File propertiesfile=new File("fileName.props");
propstosave.store(new FileOutputStream(propertiesfile),"groupnames");
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
