public final class XSSFParser extends Object
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.| Modifier and Type | Method and Description |
|---|---|
static XSSFWorkbook |
parse(File file)
Parse the given InputStream and return a new
XSSFWorkbook instance. |
static XSSFWorkbook |
parse(InputStream stream)
Parse the given InputStream and return a new
XSSFWorkbook instance. |
static XSSFWorkbook |
parse(InputStream stream,
boolean closeStream)
Parse the given InputStream and return a new
XSSFWorkbook instance. |
static XSSFWorkbook |
parse(OPCPackage pkg)
Parse the given
OPCPackage and return a new XSSFWorkbook instance. |
static XSSFWorkbook |
parse(PackagePart packagePart)
Parse the given
PackagePart and return a new XSSFWorkbook instance. |
public static XSSFWorkbook parse(InputStream stream) throws XSSFReadException, IOException
XSSFWorkbook instance.stream - the data to parse (will be closed after parsing)XSSFWorkbook instanceXSSFReadException - if an error occurs while reading the fileIOException - if an I/O error occurs while reading the filepublic static XSSFWorkbook parse(InputStream stream, boolean closeStream) throws XSSFReadException, IOException
XSSFWorkbook instance.stream - the data to parsecloseStream - whether to close the InputStream after parsingXSSFWorkbook instanceXSSFReadException - if an error occurs while reading the fileIOException - if an I/O error occurs while reading the filepublic static XSSFWorkbook parse(File file) throws XSSFReadException, IOException
XSSFWorkbook instance.file - to parseXSSFWorkbook instanceXSSFReadException - if an error occurs while reading the fileIOException - if an I/O error occurs while reading the filepublic static XSSFWorkbook parse(OPCPackage pkg) throws XSSFReadException, IOException
OPCPackage and return a new XSSFWorkbook instance.pkg - to parseXSSFWorkbook instanceXSSFReadException - if an error occurs while reading the fileIOException - if an I/O error occurs while reading the filepublic static XSSFWorkbook parse(PackagePart packagePart) throws XSSFReadException, IOException
PackagePart and return a new XSSFWorkbook instance.packagePart - to parseXSSFWorkbook instanceXSSFReadException - if an error occurs while reading the fileIOException - if an I/O error occurs while reading the file