List of usage examples for org.aspectj.util FileUtil readAsByteArray
public static byte[] readAsByteArray(InputStream inStream) throws IOException
From source file:com.qycloud.oatos.license.web.HomeController.java
@RequestMapping(value = "/api/lic/download/{licId}", method = RequestMethod.GET) @ResponseBody/* w ww . j a va 2 s . co m*/ public ResponseEntity<byte[]> downloadLic(@PathVariable long licId, @RequestParam(value = "ut", required = true) String ut) { try { HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_OCTET_STREAM); headers.setContentDispositionFormData("attachment", "oatos.lic"); return new ResponseEntity<byte[]>(FileUtil.readAsByteArray(this.licService.downloadLic(licId)), headers, HttpStatus.CREATED); } catch (Exception ex) { ex.printStackTrace(); return null; } }