|
BeanIO 2.0.4 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.beanio.stream.csv.CsvWriter
public class CsvWriter
A CsvWriter is used to format and write records, of String arrays, to a CSV output stream. Using default settings, the CSV format supported is defined by specification RFC 4180.
The writer also supports the following customizations:
Constructor Summary | |
---|---|
CsvWriter(Writer out)
Constructs a new CsvWriter using default settings. |
|
CsvWriter(Writer out,
CsvParserConfiguration config)
Constructs a new CsvWriter. |
Method Summary | |
---|---|
void |
close()
Closes the output stream. |
void |
flush()
Flushes the output stream. |
int |
getLineNumber()
Returns the last line number written to the output stream. |
void |
write(Object value)
Writes a record object to this output stream. |
void |
write(String[] record)
Formats and writes a record to this output stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CsvWriter(Writer out)
out
- the output stream to write topublic CsvWriter(Writer out, CsvParserConfiguration config)
out
- the output stream to write toconfig
- the CsvParserConfiguration
Method Detail |
---|
public int getLineNumber()
public void write(Object value) throws IOException
RecordWriter
write
in interface RecordWriter
value
- the record object to write
IOException
- if an I/O error occurs writing the record to the streampublic void write(String[] record) throws IOException
record
- the record to write
IOException
- if an I/O error occurspublic void flush() throws IOException
RecordWriter
flush
in interface RecordWriter
IOException
- if an I/O error occurs flushing the streampublic void close() throws IOException
RecordWriter
close
in interface RecordWriter
IOException
- if an I/O error occurs closing the stream
|
BeanIO 2.0.4 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |