Add constructor with writer.
authorMathieu Baudier <mbaudier@argeo.org>
Wed, 11 Nov 2020 17:26:18 +0000 (18:26 +0100)
committerMathieu Baudier <mbaudier@argeo.org>
Wed, 11 Nov 2020 17:26:18 +0000 (18:26 +0100)
org.argeo.core/src/org/argeo/util/CsvWriter.java

index 41ea65dd4903a88af162c640475160929d2c5210..a4fe15bfa74a503c8a56bfdd2f9ec1eff9018b5b 100644 (file)
@@ -56,6 +56,15 @@ public class CsvWriter {
                this.out = new OutputStreamWriter(out, charset);
        }
 
+       /**
+        * Creates a CSV writer.
+        * 
+        * @param out     the stream to write to. Caller is responsible for closing it.
+        */
+       public CsvWriter(Writer writer) {
+               this.out = writer;
+       }
+
        /**
         * Write a CSV line. Also used to write a header if needed (this is transparent
         * for the CSV writer): simply call it first, before writing the lines.