File tree Expand file tree Collapse file tree
src/main/java/org/apache/commons/csv Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020import static org .apache .commons .io .IOUtils .EOF ;
2121
2222import java .io .File ;
23- import java .io .FileOutputStream ;
2423import java .io .IOException ;
2524import java .io .InputStream ;
2625import java .io .OutputStream ;
27- import java .io .OutputStreamWriter ;
2826import java .io .Reader ;
2927import java .io .Serializable ;
3028import java .io .StringWriter ;
@@ -2069,8 +2067,7 @@ public CSVPrinter print(final Appendable out) throws IOException {
20692067 */
20702068 @ SuppressWarnings ("resource" )
20712069 public CSVPrinter print (final File out , final Charset charset ) throws IOException {
2072- // The writer will be closed when close() is called.
2073- return new CSVPrinter (new OutputStreamWriter (new FileOutputStream (out ), charset ), this );
2070+ return print (out .toPath (), charset );
20742071 }
20752072
20762073 private void print (final InputStream inputStream , final Appendable out , final boolean newRecord ) throws IOException {
You can’t perform that action at this time.
0 commit comments