public static class StreamingReader.Builder extends Object
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
avoidTempFiles() |
StreamingReader.Builder |
bufferSize(int bufferSize)
The number of bytes to read into memory from the input
resource.
|
boolean |
convertFromOoXmlStrict() |
StreamingReader.Builder |
convertFromOoXmlStrict(boolean convertFromOoXmlStrict)
Deprecated.
this is no longer needed, OOXML strict format is handled automatically
|
boolean |
encryptSstTempFile() |
int |
getBufferSize() |
String |
getPassword() |
int |
getRowCacheSize() |
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.
|
boolean |
readComments() |
boolean |
readCoreProperties() |
boolean |
readShapes() |
StreamingReader.Builder |
rowCacheSize(int rowCacheSize)
The number of rows to keep in memory at any given point.
|
StreamingReader.Builder |
setAvoidTempFiles(boolean avoidTempFiles)
Enables a mode where the code tries to avoid creating temp files.
|
StreamingReader.Builder |
setEncryptSstTempFile(boolean encryptSstTempFile)
Enables use of encryption in Shared Strings Table temp file.
|
StreamingReader.Builder |
setReadComments(boolean readComments)
Enables the reading of the comments.
|
StreamingReader.Builder |
setReadCoreProperties(boolean readCoreProperties)
Enables the reading of the core document properties.
|
StreamingReader.Builder |
setReadShapes(boolean readShapes)
Enables the reading of shape data.
|
StreamingReader.Builder |
setUseSstTempFile(boolean useSstTempFile)
Enables use of Shared Strings Table temp file.
|
boolean |
useSstTempFile() |
public int getRowCacheSize()
public int getBufferSize()
public String getPassword()
public boolean avoidTempFiles()
public boolean useSstTempFile()
public boolean encryptSstTempFile()
useSstTempFile()
is true.public boolean readComments()
public boolean readCoreProperties()
public boolean readShapes()
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 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@Deprecated public StreamingReader.Builder convertFromOoXmlStrict(boolean convertFromOoXmlStrict)
convertFromOoXmlStrict - whether to convert from OOXMLBuilderpublic StreamingReader.Builder setAvoidTempFiles(boolean avoidTempFiles)
#setUseSstTempFile.
By default, temp files are used to avoid holding onto too much data in memory.
avoidTempFiles - whether to avoid using temp files when reading from input streamsBuilderpublic 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 setReadComments(boolean readComments)
readComments - whether to read the comments associated with sheets and cellsBuilderpublic StreamingReader.Builder setReadCoreProperties(boolean readCoreProperties)
readCoreProperties - whether to read the core document propertiesBuilderpublic StreamingReader.Builder setReadShapes(boolean readShapes)
readShapes - whether to read shapes (associated with pictures that appear in sheets)Builderpublic 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 fileCopyright © 2021. All rights reserved.