| Modifier and Type | Field and Description |
|---|---|
protected boolean |
firstItem |
protected String |
newline |
protected Writer |
out |
protected char |
sep |
protected String |
separator |
| Constructor and Description |
|---|
CSVWriter(Writer writer)
Construct a CSVWriter with default separator (",") and newline
("\r\n").
|
CSVWriter(Writer writer,
String separator,
String newline)
Construct a CSVWriter with specific separator and newline.
|
| Modifier and Type | Method and Description |
|---|---|
CSVWriter |
append(byte value)
Append a byte to the CSV.
|
CSVWriter |
append(double value)
Append a double to the CSV.
|
CSVWriter |
append(float value)
Append a float to the CSV.
|
CSVWriter |
append(int value)
Append an int to the CSV.
|
CSVWriter |
append(long value)
Append a long to the CSV.
|
CSVWriter |
append(Object value)
Append a value to the CSV.
|
CSVWriter |
append(short value)
Append a short to the CSV.
|
CSVWriter |
append(String value)
Append a value (or a header) to the CSV.
|
void |
close() |
CSVWriter |
endRow()
End a row in the CSV.
|
void |
flush() |
protected Writer out
protected final String separator
protected final String newline
protected final char sep
protected boolean firstItem
public CSVWriter(Writer writer)
writer - public CSVWriter append(String value) throws IOException
value - IOExceptionpublic CSVWriter append(Object value) throws IOException
value - IOExceptionpublic CSVWriter append(byte value) throws IOException
value - IOExceptionpublic CSVWriter append(short value) throws IOException
value - IOExceptionpublic CSVWriter append(int value) throws IOException
value - IOExceptionpublic CSVWriter append(long value) throws IOException
value - IOExceptionpublic CSVWriter append(float value) throws IOException
value - IOExceptionpublic CSVWriter append(double value) throws IOException
value - IOExceptionpublic CSVWriter endRow() throws IOException
IOExceptionpublic void flush()
throws IOException
flush in interface FlushableIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOException