Package org.openforis.commons.io.csv
Class CsvWriter
java.lang.Object
org.openforis.commons.io.csv.CsvProcessor
org.openforis.commons.io.flat.FlatDataWriter
org.openforis.commons.io.csv.CsvWriter
- All Implemented Interfaces:
Closeable,AutoCloseable
- Author:
- G. Miceli, S. Ricci
-
Field Summary
Fields inherited from class org.openforis.commons.io.flat.FlatDataWriter
headersWritten, linesWritten -
Constructor Summary
ConstructorsConstructorDescriptionCsvWriter(OutputStream out) Constructs the writer using the specifiedOutputStreamto write the CSV file.CsvWriter(OutputStream out, String charsetName) Constructs the writer using the specifiedOutputStreamand the specified charset encoding to write the CSV file.CsvWriter(OutputStream out, String charsetName, char separator, char quotechar) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidflush()protected voidwriteNextInternal(Object[] values) Methods inherited from class org.openforis.commons.io.flat.FlatDataWriter
getLinesWritten, isHeadersWritten, writeAll, writeHeaders, writeHeaders, writeHeaders, writeNext, writeNext, writeNextMethods inherited from class org.openforis.commons.io.csv.CsvProcessor
getDateFormat, getFieldNames, getFields, setDateFormat, setDateFormat, setFieldNames, setFields, setFields
-
Constructor Details
-
CsvWriter
-
CsvWriter
Constructs the writer using the specifiedOutputStreamto write the CSV file. The default charset encoding will be UTF_8- Throws:
UnsupportedEncodingException
-
CsvWriter
Constructs the writer using the specifiedOutputStreamand the specified charset encoding to write the CSV file.- Throws:
UnsupportedEncodingException
-
CsvWriter
public CsvWriter(OutputStream out, String charsetName, char separator, char quotechar) throws UnsupportedEncodingException - Throws:
UnsupportedEncodingException
-
CsvWriter
-
-
Method Details
-
writeNextInternal
- Specified by:
writeNextInternalin classFlatDataWriter
-
flush
- Specified by:
flushin classFlatDataWriter- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classFlatDataWriter- Throws:
IOException
-