随笔 - 441  文章 - 4  评论 - 84  阅读 - 109万 
08 2011 档案
spring 读取资源文件方法
摘要:1.spring配置文件<beanid="configproperties"class="org.springframework.beans.factory.config.PropertiesFactoryBean"><propertyname="location"value="classpath:jdbc.properties"/></bean>2.读取属性方法ApplicationContextc=newClassPathXmlApplicationContext(" 阅读全文
posted @ 2011-08-06 00:07 自由港 阅读(2254) 评论(0) 推荐(0) 编辑
转 java 读取文件的字符集
摘要:public static String getCharset(File file) { String charset = "GBK"; byte[] first3Bytes = new byte[3]; try { boolean checked = false; BufferedInputStream bis = new BufferedInputStream( new FileInputStream(file)); bis.mark(0); int read = bis.read(first3Bytes, 0, 3); if (read == -1) return c 阅读全文
posted @ 2011-08-01 14:02 自由港 阅读(418) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示