我采用一下方式读取文件,在我开发(windows2000)上没有问题,程序运行正常,然而在Redhat AS4 linux 上运行却读取
40多后就不能读取了,程序就停止在注释1的行上(其实程序没有停止,进程还在运行,只是不往下运行了),真不知道为什么,向各位高手求救!!!
我的程序;
String strBuf = null;
        InputStreamReader reader = null;
        FileInputStream input = null;
        BufferedReader in = null;        try {
            input = new FileInputStream(file);
            reader = new InputStreamReader(input, Constants.FILE_ENCODING);
            in = new BufferedReader(reader);            while ((strBuf = in.readLine()) != null) {      // 1                if (zf_pattern.matcher(strBuf).matches()) {
//                    logger.warn("find a validate code:" + strBuf);
                    synchBussinessInfoData = new SynchBussinessInfoData();
                    st = new StringTokenizer(strBuf);
                    //记录到synchBussinessInfoData类
                       synchBussinessInfoData.setSecondID(st.nextToken(token).trim());
                    synchBussinessInfoData.setSecondName(st.nextToken(token).trim());
                    synchBussinessInfoData.setFirstID(st.nextToken(token).trim());
                    synchBussinessInfoData.setFirstName(st.nextToken(token).trim());
                    list.add(synchBussinessInfoData);
                } else {
                    logger.error("not find a validate code.");
                    logger.error("ERROR:"+strBuf);
                    list.clear();
                    break;
                }
            }