*
* @param fileName 待加载的Excel文件。
* @throws Throwable
*/
public void load(String fileName) throws Throwable {
ExcelDataParser parser = null;
InputStream inp = new FileInputStream(fileName);
if (!inp.markSupported())
inp = new PushbackInputStream(inp, 8);
if (POIFSFileSystem.hasPOIFSHeader(inp)) {
parser = new HSSFParser(this);
} else if (POIXMLDocument.hasOOXMLHeader(inp)) {
parser = new XSSFParser(this);
}
if (null == parser) {
throw new IllegalArgumentException("Your InputStream was neither an OLE2 stream, nor an OOXML stream");
}
parser.setDateFormateString(dateFormateString);
parser.parser(fileName);
this.sheetCount = parser.getSheetCount();
}