We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
做excel上传的时候,流是获取到了,但是在 public static ExcelTypeEnum valueOf(InputStream inputStream){ try { if (!inputStream.markSupported()) { return null; } FileMagic fileMagic = FileMagic.valueOf(inputStream); if(FileMagic.OLE2.equals(fileMagic)){ return XLS; } if(FileMagic.OOXML.equals(fileMagic)){ return XLSX; } return null; } catch (IOException e) { throw new RuntimeException(e); } }
inputStream.markSupported中报错,返回的为false,我上传的文件是xlsx类型的,确认没问题,看源码发现作者把值设为了true,我这边改不了源码,求解
The text was updated successfully, but these errors were encountered:
问题解决了,文件流还要转成buffer, inputStream = new BufferedInputStream(file.getInputStream()); 建议作者在读取的时候标注下inputStream的类型,以免引起混淆。 EasyExcelFactory.read(inputStream, new Sheet(1, 1, Model.class));
Sorry, something went wrong.
新版本 可以不用这个。遇到这个问题建议升级版本
No branches or pull requests
做excel上传的时候,流是获取到了,但是在
public static ExcelTypeEnum valueOf(InputStream inputStream){
try {
if (!inputStream.markSupported()) {
return null;
}
FileMagic fileMagic = FileMagic.valueOf(inputStream);
if(FileMagic.OLE2.equals(fileMagic)){
return XLS;
}
if(FileMagic.OOXML.equals(fileMagic)){
return XLSX;
}
return null;
} catch (IOException e) {
throw new RuntimeException(e);
}
}
inputStream.markSupported中报错,返回的为false,我上传的文件是xlsx类型的,确认没问题,看源码发现作者把值设为了true,我这边改不了源码,求解
The text was updated successfully, but these errors were encountered: