Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.poi.xssf.streaming
Class SheetDataWriter

    java.lang.Object
      org.apache.poi.xssf.streaming.SheetDataWriter

Direct Known Subclasses:
  GZIPSheetDataWriter

    public class SheetDataWriter

extends java.lang.Object

Initially copied from BigGridDemo "SpreadsheetWriter". Unlike the original code which wrote the entire document, this class only writes the "sheetData" document fragment so that it was renamed to "SheetDataWriter"

Constructor Summary
`SheetDataWriter()`

Method Summary
`void` | `close()` flush and close the temp data writer.
`java.io.File` | `createTempFile()` Create a temp file to write sheet data.
`java.io.Writer` | `createWriter(java.io.File fd)` Create a writer for the sheet data.
`int` | `getLowestIndexOfFlushedRows()`
`int` | `getNumberOfCellsOfLastFlushedRow()`
`int` | `getNumberOfFlushedRows()`
`java.io.InputStream` | `getWorksheetXMLInputStream()`
`void` | `writeCell(int columnIndex, org.apache.poi.ss.usermodel.Cell cell)`
`void` | `writeRow(int rownum, SXSSFRow row)` Write a row to the file

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SheetDataWriter

    public SheetDataWriter()
                    throws java.io.IOException

Throws:
  `java.io.IOException`

Method Detail

### createTempFile

    public java.io.File createTempFile()
                                throws java.io.IOException

  Create a temp file to write sheet data. By default, temp files are created in the default temporary-file directory with a prefix "poi-sxssf-sheet" and suffix ".xml". Subclasses can override it and specify a different temp directory or filename or suffix, e.g. `.gz`

  Returns:
    temp file to write sheet data
  Throws:
    `java.io.IOException`

### createWriter

    public java.io.Writer createWriter(java.io.File fd)
                                throws java.io.IOException

  Create a writer for the sheet data.

  Parameters:
    `fd` - the file to write to
  Throws:
    `java.io.IOException`

### close

    public void close()
               throws java.io.IOException

  flush and close the temp data writer. This method must be invoked before calling `getWorksheetXMLInputStream()`

  Throws:
    `java.io.IOException`

### getWorksheetXMLInputStream

    public java.io.InputStream getWorksheetXMLInputStream()
                                                   throws java.io.IOException

  Returns:
    a stream to read temp file with the sheet data
  Throws:
    `java.io.IOException`

### getNumberOfFlushedRows

    public int getNumberOfFlushedRows()

### getNumberOfCellsOfLastFlushedRow

    public int getNumberOfCellsOfLastFlushedRow()

### getLowestIndexOfFlushedRows

    public int getLowestIndexOfFlushedRows()

### writeRow

    public void writeRow(int rownum,
                         SXSSFRow row)
                  throws java.io.IOException

  Write a row to the file

  Parameters:
    `rownum` - 0-based row number
    `row` - a row
  Throws:
    `java.io.IOException`

### writeCell

    public void writeCell(int columnIndex,
                          org.apache.poi.ss.usermodel.Cell cell)
                   throws java.io.IOException

  Throws:
    `java.io.IOException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD