Java – use opencsv to write CSV to string without creating actual or temporary files

I'm trying to write CSV files using the opencsv library The limitation is that I don't want to create files or even temporary files on disk Is there any way to achieve it?

In my opinion, the constructor of csvwriter needs a filewriter object

thank you!

Solution

Actually, the constructor needs a writer. You can provide a stringwriter to create a string

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>