"Cannot auto-detect encoding, not enough chars\norg.glassfish.json.UnicodeDetectingInputStream.detectEncoding(UnicodeDetectingInputStream.java:131)"网络服务错误。报这个错误
代码:
InputStream download = aliyunOSSHolder.download(excelName);
ByteArrayOutputStream out = new ByteArrayOutputStream();
Workbook workbook = new Workbook();
workbook.fromJson(download);
workbook.save(out);
byte[] contents = out.toByteArray();
HttpHeaders headers = new HttpHeaders();
ResponseEntity<byte[]> responseExcel = new ResponseEntity<>(contents, headers, HttpStatus.OK); |