| Modifier and Type | Method and Description |
|---|---|
CsvWriter.CsvWriterBuilder |
bufferSize(int bufferSize)
Configures the size of the internal buffer.
|
CsvWriter |
build(java.nio.file.Path path,
java.nio.charset.Charset charset,
java.nio.file.OpenOption... openOptions)
Constructs a
CsvWriter for the specified Path. |
CsvWriter |
build(java.nio.file.Path path,
java.nio.file.OpenOption... openOptions)
Constructs a
CsvWriter for the specified Path. |
CsvWriter |
build(java.io.Writer writer)
Constructs a
CsvWriter for the specified Writer. |
CsvWriter.CsvWriterBuilder |
commentCharacter(char commentCharacter)
Sets the character that is used to prepend commented lines (default: '#' - hash/number).
|
CsvWriter.CsvWriterBuilder |
fieldSeparator(char fieldSeparator)
Sets the character that is used to separate columns (default: ',' - comma).
|
CsvWriter.CsvWriterBuilder |
lineDelimiter(LineDelimiter lineDelimiter)
Sets the delimiter that is used to separate lines (default:
LineDelimiter.CRLF). |
CsvWriter.CsvWriterBuilder |
quoteCharacter(char quoteCharacter)
Sets the character that is used to quote values (default: '"' - double quotes).
|
CsvWriter.CsvWriterBuilder |
quoteStrategy(QuoteStrategy quoteStrategy)
Sets the strategy that defines when quoting has to be performed
(default:
QuoteStrategy.REQUIRED). |
java.lang.String |
toString() |
public CsvWriter.CsvWriterBuilder fieldSeparator(char fieldSeparator)
fieldSeparator - the field separator character.public CsvWriter.CsvWriterBuilder quoteCharacter(char quoteCharacter)
quoteCharacter - the character for enclosing fields.public CsvWriter.CsvWriterBuilder commentCharacter(char commentCharacter)
commentCharacter - the character for prepending commented lines.public CsvWriter.CsvWriterBuilder quoteStrategy(QuoteStrategy quoteStrategy)
QuoteStrategy.REQUIRED).quoteStrategy - the strategy when fields should be enclosed using the quoteCharacter.public CsvWriter.CsvWriterBuilder lineDelimiter(LineDelimiter lineDelimiter)
LineDelimiter.CRLF).lineDelimiter - the line delimiter to be used.public CsvWriter.CsvWriterBuilder bufferSize(int bufferSize)
The default buffer size of 8,192 bytes usually does not need to be altered. One use-case is if you need many instances of a CsvWriter and need to optimize for instantiation time and memory footprint.
A buffer size of 0 disables the buffer.
bufferSize - the buffer size to be used (must be ≥ 0).public CsvWriter build(java.io.Writer writer)
CsvWriter for the specified Writer.
This library uses built-in buffering but writes its internal buffer to the given
writer on every CsvWriter.writeRow(String...) or
CsvWriter.writeRow(Iterable) call. Therefore, you probably want to pass in a
BufferedWriter to retain good performance.
Use build(Path, Charset, OpenOption...) for optimal performance when writing
files.
writer - the Writer to use for writing CSV data.null.java.lang.NullPointerException - if writer is nullpublic CsvWriter build(java.nio.file.Path path, java.nio.file.OpenOption... openOptions) throws java.io.IOException
CsvWriter for the specified Path.path - the path to write data to.openOptions - options specifying how the file is opened.
See Files.newOutputStream(Path, OpenOption...) for defaults.null. Don't forget to close it!java.io.IOException - if a write error occursjava.lang.NullPointerException - if path or charset is nullpublic CsvWriter build(java.nio.file.Path path, java.nio.charset.Charset charset, java.nio.file.OpenOption... openOptions) throws java.io.IOException
CsvWriter for the specified Path.path - the path to write data to.charset - the character set to be used for writing data to the file.openOptions - options specifying how the file is opened.
See Files.newOutputStream(Path, OpenOption...) for defaults.null. Don't forget to close it!java.io.IOException - if a write error occursjava.lang.NullPointerException - if path or charset is nullpublic java.lang.String toString()
toString in class java.lang.Object