軟件是對(duì)質(zhì)量的不懈追求

          LineNumberReader 指定文件編碼


          import java.io.FileInputStream;
          import java.io.IOException;
          import java.io.InputStreamReader;
          import java.io.LineNumberReader;


          public class Main {
              
              
          public static void main(String[] args) throws IOException {

                  InputStreamReader isr 
          = new InputStreamReader(new FileInputStream("15370720.pdf4"), "utf-16");
                  LineNumberReader lnr
          =new LineNumberReader(isr);
                  String line 
          = null;
                  
          while((line=lnr.readLine())!=null){  
                     System.out.println(lnr.getLineNumber()
          +"\t"+line);
                  }
             }
          }

          posted on 2010-08-05 09:13 BlakeSu 閱讀(1062) 評(píng)論(0)  編輯  收藏


          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 家居| 登封市| 宜春市| 临泽县| 普定县| 新民市| 夹江县| 高密市| 绩溪县| 肃北| 奉新县| 英吉沙县| 章丘市| 聂拉木县| 鹤山市| 板桥市| 潞西市| 阜城县| 江陵县| 漳州市| 威海市| 郯城县| 南阳市| 顺昌县| 奈曼旗| 新竹县| 临泽县| 梁河县| 新巴尔虎左旗| 澄城县| 宣武区| 新田县| 保靖县| 洮南市| 中西区| 桂平市| 辽宁省| 双流县| 朔州市| 崇仁县| 林口县|