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
class XlsxToCsvUtil.WorkbookStream extends InputStream
Input stream implementation that combines streams from all sheets in the current workbook.
-
-
Field Summary
Fields Modifier and Type Field Description private XlsxToCsvUtil.SheetInfo
currentSheet
private InputStream
currentStream
private int
nextIndex
-
Constructor Summary
Constructors Constructor Description WorkbookStream()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
void
close()
private InputStream
getPrefixedStream(XlsxToCsvUtil.SheetInfo sheet)
Create a combined stream by adding a "prefix": [sheet-name] and then the regular CSV stream for the given worksheet.private void
nextSheet()
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, transferTo
-
-
-
-
Field Detail
-
currentSheet
private XlsxToCsvUtil.SheetInfo currentSheet
-
currentStream
private InputStream currentStream
-
nextIndex
private int nextIndex
-
-
Method Detail
-
nextSheet
private void nextSheet()
Switch to the next worksheet.
-
getPrefixedStream
private InputStream getPrefixedStream(XlsxToCsvUtil.SheetInfo sheet)
Create a combined stream by adding a "prefix": [sheet-name] and then the regular CSV stream for the given worksheet.
-
available
public int available() throws IOException
- Overrides:
available
in classInputStream
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
read
public int read() throws IOException
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException
- Overrides:
read
in classInputStream
- Throws:
IOException
-
-