public FileWriter(BlockingQueue<Map<String, Object>> queue) {
this.queue = queue;
try {
FileOutputStream fos = new FileOutputStream(new File("output.csv"), true);
Writer out = new BufferedWriter(new OutputStreamWriter(fos));
csvMapWriter = new CsvMapWriter(out, EXCEL_PREFERENCE);
csvMapWriter.writeHeader(header);
} catch (IOException e) {
csvMapWriter = new CsvMapWriter(new OutputStreamWriter(System.out), EXCEL_PREFERENCE);
}
}