kotlin-csv icon indicating copy to clipboard operation
kotlin-csv copied to clipboard

Keep input stream open

Open oliverClimbs opened this issue 3 years ago • 2 comments
trafficstars

I realize that generally it doesn't make sense to keep an input stream open when the end of the stream has been reached, but I'd like to read multiple CSV files that are inside a zip file (without extracting them first). However, that's currently not possible since the input stream gets closed when the end of the current zip entry is reached.

oliverClimbs avatar Jul 09 '22 18:07 oliverClimbs

@oliverClimbs Hi, thanks for your useful feedback! I think it's would be good to introduce the withoutClosingInputStream: Boolean option on the CSV reader. https://github.com/doyaaaaaken/kotlin-csv#customize This option's default value is false, and if true is set the input stream keep open (and you need to close it manually).

Does this idea solve your problem?

doyaaaaaken avatar Jul 11 '22 10:07 doyaaaaaken

Yes, that would be a good solution.

oliverClimbs avatar Jul 11 '22 10:07 oliverClimbs