自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(0)
  • 资源 (2)
  • 收藏
  • 关注

空空如也

ExcelUtils.java

HSSFWorkbook是操作Excel2003以前(包括2003)的版本,扩展名为.xls,所以每个Sheet局限就是导出的行数至多为65535行,一般不会发生内存不足的情况(OOM) * XSSFWorkbook对应的是EXCEL2007以后的版本(1048576行,16384列)扩展名.xlsx,每个Sheet最多可以导出104万行,不过这样就伴随着一个OOM内存溢出的问题,原因是你所创建的sheet row cell 等此时是存在内存中的,随着数据量增大 ,内存的需求量也就增大,那么很大可能就是要OOM了

2020-06-29

服务器下载文件

String file_unique = request.getParameter("file_unique"); String date = file_unique.substring(0,7); path = date+"/"+file_unique; System.out.println("--下载路径--:"+path); System.out.println("----"); System.out.println("--------"); //sPath = HttpRequest.forwardIn(restTemplate,"http://common-method/","getFileUrl",obj); InputStream fis=new BufferedInputStream(new FileInputStream(path)); System.out.println("----当前路径----"+new File(".").getAbsolutePath()); byte[] buffer = new byte[fis.available()]; fis.read(buffer); fis.close(); response.reset(); System.out.println("--输入流--:"+fis); System.out.println("----"); System.out.println("--------"); file_unique = new String(file_unique.getBytes(), "ISO-8859-1"); System.out.println("--下载文件名称--:"+file_unique); System.out.println("----"); System.out.println("--------"); response.addHeader("Content-Disposition","attachment;filename=" + file_unique); OutputStream toClient = new BufferedOutputStream(response.getOutputStream()); response.setContentType("application/octet-stream"); System.out.println("--输出流--:"+toClient); System.out.println("----"); System.out.println("--------"); toClient.write(buffer); System.out.println(buffer.toString()); toClient.flush(); toClient.close();

2019-04-30

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除