public class CSVWriter extends Object
| Constructor and Description |
|---|
CSVWriter(Writer w)
Makes a new CSVWriter that writes to the given writer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Flushes and closes underlying writer.
|
protected void |
endRecord() |
void |
flush() |
void |
setDelimiter(char c)
Sets the delimiter of a field.
|
void |
setSeparator(char s)
Sets the field separator.
|
void |
write(Object... fields)
Writes some objects to CSV, each object as one more field in the current
record.
|
void |
writeln(Object... fields)
Writes some objects to CSV, each object as one more field in the current
record, and then writes a line ending to terminate the record, and
flushes the underlying writer.
|
public CSVWriter(Writer w)
w - Where the data will go.public void setSeparator(char s)
public void setDelimiter(char c)
public void write(Object... fields) throws IOException
fields - Meant for primitives and String. Other objects are converted
to String by toString(), and null is represented "null".IOException - Writing has failed.public void writeln(Object... fields) throws IOException
fields - Meant for primitives and String. Other objects are converted
to String by toString(), and null is represented by "null".IOException - Writing has failed.protected void endRecord()
throws IOException
IOExceptionpublic void flush()
throws IOException
IOExceptionpublic void close()
throws IOException
IOExceptionCopyright © 2018. All rights reserved.