public class CsvWriter
extends java.lang.Object
Writer
to
allow easy writing of lines of data delimited by a particular string.
Despite the name of the class, any string may be used as the delimiter.Constructor and Description |
---|
CsvWriter(java.io.Writer writer)
Creates a new CSV writer which will write to the specified writer
using a comma as the field delimiter.
|
CsvWriter(java.io.Writer writer,
java.lang.String separator)
Creates a new CSV writer which will write to the specified writer
and delimit fields with the specified string.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the underlying writer supplied to this CSV writer's constructor.
|
void |
writeCsv(java.lang.Object... objects)
Writes a line to the writer provided to the constructor.
|
public CsvWriter(java.io.Writer writer, java.lang.String separator)
writer
- the writer to which to writeseparator
- the separator which will be placed between the fieldspublic CsvWriter(java.io.Writer writer)
writer
- writer the writer to which to writepublic void writeCsv(java.lang.Object... objects) throws java.io.IOException
objects
- the objects to writejava.io.IOException
- if an I/O error occurs during writingpublic void close() throws java.io.IOException
java.io.IOException
- if an I/O error occurs