public static class StreamingReader.Builder extends Object
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
StreamingReader.Builder |
bufferSize(int bufferSize)
The number of bytes to read into memory from the input
resource.
|
boolean |
convertFromOoXmlStrict() |
StreamingReader.Builder |
convertFromOoXmlStrict(boolean convertFromOoXmlStrict)
Convert the file from Strict OOXML to regular XLSX.
|
boolean |
encryptSstTempFile() |
int |
getBufferSize() |
String |
getPassword() |
int |
getRowCacheSize() |
int |
getSheetIndex()
Deprecated.
This method will be removed in a future release.
|
String |
getSheetName()
Deprecated.
This method will be removed in a future release.
|
org.apache.poi.ss.usermodel.Workbook |
open(File file)
Reads a given
File and returns a new instance
of Workbook. |
org.apache.poi.ss.usermodel.Workbook |
open(InputStream is)
Reads a given
InputStream and returns a new
instance of Workbook. |
StreamingReader.Builder |
password(String password)
For password protected files specify password to open file.
|
StreamingReader |
read(File f)
Deprecated.
This method will be removed in a future release. Use
open(File) instead |
StreamingReader |
read(InputStream is)
Deprecated.
This method will be removed in a future release. Use
open(InputStream) instead |
boolean |
readCoreProperties() |
StreamingReader.Builder |
rowCacheSize(int rowCacheSize)
The number of rows to keep in memory at any given point.
|
StreamingReader.Builder |
setEncryptSstTempFile(boolean encryptSstTempFile)
Enables use of encryption in Shared Strings Table temp file.
|
StreamingReader.Builder |
setReadCoreProperties(boolean readCoreProperties)
Enables the reading of the core document properties.
|
StreamingReader.Builder |
setUseSstTempFile(boolean useSstTempFile)
Enables use of Shared Strings Table temp file.
|
StreamingReader.Builder |
sheetIndex(int sheetIndex)
Deprecated.
This method will be removed in a future release. Use
StreamingWorkbook.getSheetAt(int) instead. |
StreamingReader.Builder |
sheetName(String sheetName)
Deprecated.
This method will be removed in a future release. Use
StreamingWorkbook.getSheet(String) instead. |
boolean |
useSstTempFile() |
public int getRowCacheSize()
public int getBufferSize()
public int getSheetIndex()
public String getSheetName()
public String getPassword()
public boolean useSstTempFile()
public boolean encryptSstTempFile()
useSstTempFile()
is true.public boolean readCoreProperties()
public boolean convertFromOoXmlStrict()
public StreamingReader.Builder rowCacheSize(int rowCacheSize)
Defaults to 10
rowCacheSize - number of rowsBuilderpublic StreamingReader.Builder bufferSize(int bufferSize)
Defaults to 1024
bufferSize - buffer size in bytesBuilderpublic StreamingReader.Builder sheetIndex(int sheetIndex)
StreamingWorkbook.getSheetAt(int) instead.StreamingReader. If
more sheets need to be read, a new instance must be
created.
Defaults to 0
sheetIndex - index of sheetBuilderpublic StreamingReader.Builder sheetName(String sheetName)
StreamingWorkbook.getSheet(String) instead.StreamingReader. If
more sheets need to be read, a new instance must be
created.sheetName - name of sheetBuilderpublic StreamingReader.Builder password(String password)
ReadException is thrown on
read.
NULL indicates that no password should be used, this is the default value.
password - to use when opening fileBuilder@Beta public StreamingReader.Builder convertFromOoXmlStrict(boolean convertFromOoXmlStrict)
convertFromOoXmlStrict - whether to convert from OOXMLBuilderpublic StreamingReader.Builder setUseSstTempFile(boolean useSstTempFile)
By default, the entire SST *will* be loaded into memory. However, enabling this option at all will have some noticeable performance degradation as you are trading memory for disk space.
useSstTempFile - whether to use a temp file to store the Shared Strings Table dataBuilderpublic StreamingReader.Builder setEncryptSstTempFile(boolean encryptSstTempFile)
setUseSstTempFile
is set to true.
By default, the temp file is not encrypted. However, enabling this option could slow down the processing of Shared Strings data.
encryptSstTempFile - whether to encrypt the temp file used to store the Shared Strings Table dataBuilderpublic StreamingReader.Builder setReadCoreProperties(boolean readCoreProperties)
readCoreProperties - whether to read the core document propertiesBuilderpublic org.apache.poi.ss.usermodel.Workbook open(InputStream is)
InputStream and returns a new
instance of Workbook. Due to Apache POI
limitations, a temporary file must be written in order
to create a streaming iterator. This process will use
the same buffer size as specified in bufferSize(int).is - input stream to read inWorkbook that can be read fromReadException - if there is an issue reading the streampublic org.apache.poi.ss.usermodel.Workbook open(File file)
File and returns a new instance
of Workbook.file - file to read inOpenException - if there is an issue opening the fileReadException - if there is an issue reading the filepublic StreamingReader read(InputStream is)
open(InputStream) insteadInputStream and returns a new
instance of StreamingReader. Due to Apache POI
limitations, a temporary file must be written in order
to create a streaming iterator. This process will use
the same buffer size as specified in bufferSize(int).is - input stream to read inReadException - if there is an issue reading the streampublic StreamingReader read(File f)
open(File) insteadFile and returns a new instance
of StreamingReader.f - file to read inOpenException - if there is an issue opening the fileReadException - if there is an issue reading the fileCopyright © 2020. All rights reserved.