标签:io for art ar new type ad file
public static Workbook create(InputStream in) throws
IOException,InvalidFormatException {
if (!in.markSupported()) {
in = new PushbackInputStream(in, 8);
}
if (POIFSFileSystem.hasPOIFSHeader(in)) {
return new HSSFWorkbook(in);
}
if (POIXMLDocument.hasOOXMLHeader(in)) {
return new XSSFWorkbook(OPCPackage.open(in));
}
throw new IllegalArgumentException("你的excel版本目前poi解析不了");
}
读写xls和xlsx格式时,HSSFWorkbook针对xls,XSSFWorkbook针对xlsx
Package should contain a content type part [M1.13],布布扣,bubuko.com
Package should contain a content type part [M1.13]
标签:io for art ar new type ad file
原文地址:http://www.cnblogs.com/masw/p/3894756.html