package org.simantics.simulation.export; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.PrintStream; import org.simantics.history.HistoryException; import org.simantics.history.csv.CSVFormatter; public class CSVWriter extends CSVFormatter { public File file; public void write() throws IOException, HistoryException { FileOutputStream fos = null; try { fos = new FileOutputStream(file, true); BufferedOutputStream bos = new BufferedOutputStream( fos ); PrintStream ps = new PrintStream( bos ); formulate2( null, ps ); bos.flush(); } finally { if ( fos != null ) { try { fos.close(); } catch (IOException e) { } } } } }