Package org.apache.poi.xssf
Class XSSFParser
java.lang.Object
org.apache.poi.xssf.XSSFParser
Methods that wrap
XSSFWorkbook parsing functionality.
One difference is that the methods in this class try to
throw XSSFReadException or IOException instead of RuntimeException.
You can still get an Errors like an OutOfMemoryError.- Since:
- 5.5.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic XSSFWorkbookParse the given InputStream and return a newXSSFWorkbookinstance.static XSSFWorkbookparse(InputStream stream) Parse the given InputStream and return a newXSSFWorkbookinstance.static XSSFWorkbookparse(InputStream stream, boolean closeStream) Parse the given InputStream and return a newXSSFWorkbookinstance.static XSSFWorkbookparse(OPCPackage pkg) Parse the givenOPCPackageand return a newXSSFWorkbookinstance.static XSSFWorkbookparse(PackagePart packagePart) Parse the givenPackagePartand return a newXSSFWorkbookinstance.
-
Method Details
-
parse
Parse the given InputStream and return a newXSSFWorkbookinstance.- Parameters:
stream- the data to parse (will be closed after parsing)- Returns:
- a new
XSSFWorkbookinstance - Throws:
XSSFReadException- if an error occurs while reading the fileIOException- if an I/O error occurs while reading the file
-
parse
public static XSSFWorkbook parse(InputStream stream, boolean closeStream) throws XSSFReadException, IOException Parse the given InputStream and return a newXSSFWorkbookinstance.- Parameters:
stream- the data to parsecloseStream- whether to close the InputStream after parsing- Returns:
- a new
XSSFWorkbookinstance - Throws:
XSSFReadException- if an error occurs while reading the fileIOException- if an I/O error occurs while reading the file
-
parse
Parse the given InputStream and return a newXSSFWorkbookinstance.- Parameters:
file- to parse- Returns:
- a new
XSSFWorkbookinstance - Throws:
XSSFReadException- if an error occurs while reading the fileIOException- if an I/O error occurs while reading the file
-
parse
Parse the givenOPCPackageand return a newXSSFWorkbookinstance.- Parameters:
pkg- to parse- Returns:
- a new
XSSFWorkbookinstance - Throws:
XSSFReadException- if an error occurs while reading the fileIOException- if an I/O error occurs while reading the file
-
parse
Parse the givenPackagePartand return a newXSSFWorkbookinstance.- Parameters:
packagePart- to parse- Returns:
- a new
XSSFWorkbookinstance - Throws:
XSSFReadException- if an error occurs while reading the fileIOException- if an I/O error occurs while reading the file
-