紧急求助!!up有分文件下载时中途停止下载,后台报java.lang.ArrayIndexOutOfBoundsException

simplexc 2012-10-30 09:39:25
各位大侠帮小弟看一眼吧。提个解决方案。。。
程序: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)
...全文
96 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
simplexc 2012-10-31
  • 打赏
  • 举报
回复
大家多多支持一下 Up一下吧。。紧急紧急。

50,526

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧