紧急求助!!up有分文件下载时中途停止下载,后台报java.lang.ArrayIndexOutOfBoundsException
各位大侠帮小弟看一眼吧。提个解决方案。。。
程序:in = new BufferedInputStream(
new FileInputStream(exportFile.getPath()));
response.reset();
response.setContentType("application/pdf");
String filename = new String(
filePath.getBytes("GBK"), "ISO8859_1").trim();
response.setHeader("Content-Disposition","inline;attachment;filename="+filename);
out = new BufferedOutputStream(response.getOutputStream());
int i = 0;
while ((i = in.read()) != -1) {
out.write(i);
}
out.flush();
} catch (IOException e) {
e.printStackTrace();
}
catch (Exception e)
{
File file;
e.printStackTrace();
}
finally
{
File file;
if (out != null) {
try {
out.close();
} catch (IOException ex) {
ex.printStackTrace();
}
}
错误信息:
12/10/30 11:01:55 java.lang.ArrayIndexOutOfBoundsException
12/10/30 11:01:55 at java.lang.System.arraycopy(Native Method)
12/10/30 11:01:55 at com.evermind.server.http.EvermindServletOutputStream.write(EvermindServletOutputStream.java:216)
12/10/30 11:01:55 at com.evermind.server.http.EvermindServletOutputStream.write(EvermindServletOutputStream.java:151)
12/10/30 11:01:55 at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:66)
12/10/30 11:01:55 at java.io.BufferedOutputStream.write(BufferedOutputStream.java:79)
[解决办法]
大家多多支持一下 Up一下吧。。紧急紧急。