阅读背景:

Java:Javolution:如何正确使用UTF8StreamReader?发生错误引起:java.lang.ArrayIndexOutOfBoundsException:2048

来源:互联网 

Here's the code:

这是代码:

public static void mergeAllFilesJavolution()throws FileNotFoundException, IOException {
    String fileDir = "C:\TestData\w12";
    File dirSrc = new File(fileDir);
    File[] list = dirSrc.listFiles();
    long start = System.currentTimeMillis();
    for(int j=0; j<list.length; j++){
        int chr;
        String srcFile = list[j].getPath();
        String outFile = fileDir + "\..\merged.txt";
        UTF8StreamReader inFile=new UTF8StreamReader().setInput(new FileInputStream(srcFile));
        UTF8StreamWriter outPut=new UTF8StreamWriter().setOutput(new FileOutputStream(outFile, true)); 
        while((chr=inFile.read()) != -1) {
            outPut.write(chr);
        }
        outPut.close();
        inFile.close();
    }
    System.out.println(System.currentTimeMillis()-start);
}
public static void m



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: