public final class CsvWriter
extends java.lang.Object
implements java.io.Closeable
Example use:
try (CsvWriter csv = CsvWriter.builder().build(path, StandardCharsets.UTF_8)) {
csv.writeRow("Hello", "world");
}
| Modifier and Type | Class and Description |
|---|---|
static class |
CsvWriter.CsvWriterBuilder
This builder is used to create configured instances of
CsvWriter. |
| Modifier and Type | Method and Description |
|---|---|
static CsvWriter.CsvWriterBuilder |
builder()
Creates a
CsvWriter.CsvWriterBuilder instance used to configure and create instances of
this class. |
void |
close() |
CsvWriter |
writeRow(java.lang.Iterable<java.lang.String> values)
Appends a complete line - one or more fields and new line character(s) at the end.
|
CsvWriter |
writeRow(java.lang.String... values)
Appends a complete line - one or more fields and new line character(s) at the end.
|
public static CsvWriter.CsvWriterBuilder builder()
CsvWriter.CsvWriterBuilder instance used to configure and create instances of
this class.public CsvWriter writeRow(java.lang.Iterable<java.lang.String> values)
values - the fields to append (null values are handled as empty strings, if
not configured otherwise (QuoteStrategy.EMPTY))java.io.UncheckedIOException - if a write error occurspublic CsvWriter writeRow(java.lang.String... values)
values - the fields to append (null values are handled as empty strings, if
not configured otherwise (QuoteStrategy.EMPTY))java.io.UncheckedIOException - if a write error occurspublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOException