Package net.sf.basedb.util.excel
Class XlsxToCsvUtil.WorkbookStream
java.lang.Object
java.io.InputStream
net.sf.basedb.util.excel.XlsxToCsvUtil.WorkbookStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Enclosing class:
- XlsxToCsvUtil
Input stream implementation that combines streams from all sheets in the current workbook.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
void
close()
private InputStream
Create a combined stream by adding a "prefix": [sheet-name] and then the regular CSV stream for the given worksheet.private void
Switch to the next worksheet.int
read()
int
read
(byte[] b, int off, int len) Methods inherited from class java.io.InputStream
mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
Field Details
-
currentSheet
-
currentStream
-
nextIndex
private int nextIndex
-
-
Constructor Details
-
WorkbookStream
WorkbookStream()
-
-
Method Details
-
nextSheet
private void nextSheet()Switch to the next worksheet. -
getPrefixedStream
Create a combined stream by adding a "prefix": [sheet-name] and then the regular CSV stream for the given worksheet. -
available
- Overrides:
available
in classInputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-