随笔 - 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("
阅读全文
转 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
阅读全文