java制定编码的读取

        FileInputStream fs=new FileInputStream(fileName);
        InputStreamReader fileRead=new InputStreamReader(fs,"UTF-8");
        BufferedReader read=new BufferedReader(fileRead);
        String line;
        try
        {
            int count=0;
            while ((line = read.readLine()) != null)
            {
                if(count==0){
                    count++;
                    continue;
                }
                StringTokenizer st = new StringTokenizer(line, "|");
                String reverse = st.nextToken();
                String word=st.nextToken();//nextToken()是取下一个
            }
        } 

posted on 2012-05-12 14:10  雨渐渐  阅读(107)  评论(0编辑  收藏  举报

导航