Skip to content

Commit

Permalink
Use a new encoder for each csv writer to avoid concurrency problems.
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz committed Mar 10, 2014
1 parent b951ed4 commit 178fa9b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/edu/washington/escience/myria/CsvTupleWriter.java
Expand Up @@ -6,6 +6,7 @@
import java.io.OutputStreamWriter;
import java.util.List;

import org.supercsv.encoder.DefaultCsvEncoder;
import org.supercsv.io.CsvListWriter;
import org.supercsv.prefs.CsvPreference;

Expand Down Expand Up @@ -47,7 +48,7 @@ public CsvTupleWriter(final OutputStream out) {
public CsvTupleWriter(final char separator, final OutputStream out) {
final CsvPreference separatorPreference =
new CsvPreference.Builder(Character.toChars(CsvPreference.STANDARD_PREFERENCE.getQuoteChar())[0], separator,
CsvPreference.STANDARD_PREFERENCE.getEndOfLineSymbols()).build();
CsvPreference.STANDARD_PREFERENCE.getEndOfLineSymbols()).useEncoder(new DefaultCsvEncoder()).build();
csvWriter = new CsvListWriter(new BufferedWriter(new OutputStreamWriter(out)), separatorPreference);
}

Expand Down

0 comments on commit 178fa9b

Please sign in to comment.