Skip to content

Commit f96adf2

Browse files
committed
[CSV-205]
Add convenience API CSVFormat#printer() to print to System.out.
1 parent 9afec3e commit f96adf2

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

src/changes/changes.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
<action issue="CSV-190" type="add" dev="ggregory" due-to="Gary Gregory">Add convenience API CSVFormat.print(File, Charset)</action>
4949
<action issue="CSV-191" type="add" dev="ggregory" due-to="Gary Gregory">Add convenience API CSVFormat.print(Path, Charset)</action>
5050
<action issue="CSV-192" type="add" dev="ggregory" due-to="Gary Gregory">Add convenience API CSVParser.parse(Path, Charset, CSVFormat)</action>
51+
<action issue="CSV-205" type="add" dev="ggregory" due-to="Gary Gregory">Add convenience API CSVFormat#printer() to print to System.out</action>
5152
</release>
5253
<release version="1.4" date="2016-05-28" description="Feature and bug fix release">
5354
<action issue="CSV-181" type="update" dev="ggregory" due-to="Gary Gregory">Make CSVPrinter.print(Object) GC-free.</action>

src/main/java/org/apache/commons/csv/CSVFormat.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,22 @@ public CSVPrinter print(final Appendable out) throws IOException {
869869
return new CSVPrinter(out, this);
870870
}
871871

872+
/**
873+
* Prints to the {@link System#out}.
874+
*
875+
* <p>
876+
* See also {@link CSVPrinter}.
877+
* </p>
878+
*
879+
* @return a printer to {@link System#out}.
880+
* @throws IOException
881+
* thrown if the optional header cannot be printed.
882+
* @since 1.5
883+
*/
884+
public CSVPrinter printer() throws IOException {
885+
return new CSVPrinter(System.out, this);
886+
}
887+
872888
/**
873889
* Prints to the specified output.
874890
*

0 commit comments

Comments
 (0)