public class SheetDataWriter
extends java.lang.Object
implements java.io.Closeable
Modifier and Type | Field and Description |
---|---|
protected java.io.Writer |
_out |
Constructor and Description |
---|
SheetDataWriter() |
SheetDataWriter(SharedStringsTable sharedStringsTable) |
SheetDataWriter(java.io.Writer writer) |
Modifier and Type | Method and Description |
---|---|
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.
(为工作表数据创建编写器。)
|
protected java.io.InputStream |
decorateInputStream(java.io.FileInputStream fis)
Override this to translate (such as decrypt or expand) the file input stream as it is being read from disk.
(覆盖它以在从磁盘读取文件输入流时转换(例如解密或扩展)文件输入流。)
|
protected java.io.OutputStream |
decorateOutputStream(java.io.FileOutputStream fos)
Override this to translate (such as encrypt or compress) the file output stream as it is being written to disk.
(覆盖它以在将文件输出流写入磁盘时转换(例如加密或压缩)文件输出流。)
|
protected void |
finalize() |
int |
getLastFlushedRow() |
int |
getLowestIndexOfFlushedRows() |
int |
getNumberOfCellsOfLastFlushedRow() |
int |
getNumberOfFlushedRows() |
protected java.io.File |
getTempFile() |
java.io.InputStream |
getWorksheetXMLInputStream() |
protected void |
outputEscapedString(java.lang.String s) |
void |
writeCell(int columnIndex, Cell cell) |
void |
writeRow(int rownum, SXSSFRow row)
Write a row to the file
(向文件写入一行)
|
public SheetDataWriter() throws java.io.IOException
java.io.IOException
(java.io.IOException)
public SheetDataWriter(java.io.Writer writer) throws java.io.IOException
java.io.IOException
(java.io.IOException)
public SheetDataWriter(SharedStringsTable sharedStringsTable) throws java.io.IOException
java.io.IOException
(java.io.IOException)
public java.io.File createTempFile() throws java.io.IOException
.gz
(创建一个临时文件以写入工作表数据。默认情况下,临时文件在默认临时文件目录中创建,前缀为“poi-sxssf-sheet”,后缀为“.xml”。子类可以覆盖它并指定不同的临时目录或文件名或后缀,例如 .gz)
java.io.IOException
(java.io.IOException)
public java.io.Writer createWriter(java.io.File fd) throws java.io.IOException
fd
- the file to write to
(fd - 要写入的文件)
java.io.IOException
(java.io.IOException)
protected java.io.OutputStream decorateOutputStream(java.io.FileOutputStream fos) throws java.io.IOException
fos
- the stream to decorate
(fos - 要装饰的流)
java.io.IOException
- if decorating the stream fails
(java.io.IOException - 如果装饰流失败)
decorateInputStream(FileInputStream)
public void close() throws java.io.IOException
getWorksheetXMLInputStream()
(刷新并关闭临时数据写入器。必须在调用 getWorksheetXMLInputStream() 之前调用此方法)
close
in interface
java.io.Closeable
(在接口 java.io.Closeable 中关闭)
close
in interface
java.lang.AutoCloseable
(在接口 java.lang.AutoCloseable 中关闭)
java.io.IOException
(java.io.IOException)
protected java.io.File getTempFile()
public java.io.InputStream getWorksheetXMLInputStream() throws java.io.IOException
java.io.IOException
(java.io.IOException)
protected java.io.InputStream decorateInputStream(java.io.FileInputStream fis) throws java.io.IOException
fis
- the stream to decorate
(fis - 要装饰的流)
java.io.IOException
- if decorating the stream fails
(java.io.IOException - 如果装饰流失败)
decorateOutputStream(FileOutputStream)
public int getNumberOfFlushedRows()
public int getNumberOfCellsOfLastFlushedRow()
public int getLowestIndexOfFlushedRows()
public int getLastFlushedRow()
protected void finalize() throws java.lang.Throwable
finalize
in class
java.lang.Object
java.lang.Throwable
(java.lang.Throwable)
public void writeRow(int rownum, SXSSFRow row) throws java.io.IOException
rownum
- 0-based row number
(rownum - 从 0 开始的行号)
row
- a row
(行 - 一行)
java.io.IOException
- If an I/O error occurs
(java.io.IOException - 如果发生 I/O 错误)
public void writeCell(int columnIndex, Cell cell) throws java.io.IOException
java.io.IOException
(java.io.IOException)
protected void outputEscapedString(java.lang.String s) throws java.io.IOException
java.io.IOException
(java.io.IOException)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.