简体   繁体   中英

Under what circumstances will the constructor of apache.commons.csv.CSVPrinter throw an IOException?

According to the documentation of org.apache.commons.csv.CSVPrinter, an IOException will be thrown "if the optional header [provided in the second argument] cannot be printed". But what would cause the optional header to be unable to print? Are some strings somehow invalid in the header?

According to the source of org.apache.commons.csv.CSVPrinter , the constructor you link to writes any header comments, and the CSV header (if used), to the output stream given in the parameter out . As this involves writing to the output stream, there is the possibility that an IOException may be thrown.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM