I need to return from the server a CSV file.
I have the data which is a simple map, I DO NOT want to create a file on the disk, I saw that the write-csv function can accept as argument a writer.
Something like that (but it doesnt work):
(csv/write-csv (java.io.BufferedWriter. (java.io.OutputStream. )) csv-data)
The error:
:cause java.io.OutputStream
:via
[{:type java.lang.InstantiationError
:message java.io.OutputStream
If you just want a string, you could use with-out-str
:
(with-out-str
(csv/write-csv *out* csv-data))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With