code: public static void responseFile(HttpServletResponse response, String local, boolean isDownloaded) throws IOException {
          if (Checker.isExists(local)) {
              File file = new File(local);
              try (FileInputStream in = new FileInputStream(file); ServletOutputStream os = response.getOutputStream()) {
                  byte[] b;
                  while (in.available() > 0) {
                      b = in.available() > 1024 ? new byte[1024] : new byte[in.available()];
                      in.read(b, 0, b.length);
                      os.write(b, 0, b.length);
                  }
                  os.flush();
              }
              if (isDownloaded) {
                  String fn = new String(file.getName().getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1);
                  response.setHeader("Content-Disposition", "attachment;filename=" + fn);
              }
          } else {
              response.setStatus(404);
          }
      }
docs: 响应文件
  
  @param response {@link HttpServletResponse}
  @param local 文件路径
  @param isDownloaded 是否下载
  
  @throws IOException 异常
  @since 1.1.1