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.
|
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.
|
int |
getSstCacheSize() |
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 |
StreamingReader.Builder |
rowCacheSize(int rowCacheSize)
The number of rows to keep in memory at any given point.
|
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. |
StreamingReader.Builder |
sstCacheSize(int sstCacheSize)
!!! This option is experimental !!!
|
public int getRowCacheSize()
public int getBufferSize()
public int getSheetIndex()
public String getSheetName()
public String getPassword()
public int getSstCacheSize()
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 fileBuilderpublic StreamingReader.Builder sstCacheSize(int sstCacheSize)
By default, the entire SST *will* be loaded into memory. Setting a value greater than 0 for this option will only cache up to this many entries in memory. However, enabling this option at all will have some noticeable performance degredation as you are trading memory for disk space.
sstCacheSize - size of SST cacheBuilderpublic 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 © 2018. All rights reserved.