现在可以 用字符流读入就行了 或者字节转成字符流
- public static void testProperty(){
- FileInputStream fis =null;
- BufferedReader bufr =null;
- Properties prop = null;
- FileReader fr=null;
- try {
- fr = new FileReader("F:\\1.txt");
- //fis = new FileInputStream("F:\\1.txt");
- // bufr= new BufferedReader(new InputStreamReader(fis,"gbk"));
- prop=new Properties();
- prop.load(fr);
- prop.list(System.out);
- } catch(IOException e) {
- e.printStackTrace();
- }finally{
- try {
- if(fis!=null)
- fis.close();
- } catch (IOException e2) {
- e2.printStackTrace();
- }
- }
- }
复制代码 |