Giter Site home page Giter Site logo

Comments (6)

doyaaaaaken avatar doyaaaaaken commented on June 19, 2024 2

Released in version 1.6.0.
Thanks, @Thijsiez !! 😄

from kotlin-csv.

doyaaaaaken avatar doyaaaaaken commented on June 19, 2024 1

Sorry, this library supports output formats only as java.io.File or OutputStream.

from kotlin-csv.

doyaaaaaken avatar doyaaaaaken commented on June 19, 2024 1

Thanks for the feedback.
I think it's a good idea. I'll consider addressing this issue.

For now, I can live with writing to a temporary file in the cache and read that same file so I can have it as a String.

Yes, it's a valid workaround for this problem.

from kotlin-csv.

Thijsiez avatar Thijsiez commented on June 19, 2024 1

Not sure if this would work for your use case, but maybe writing an extension function that does something like the following would be helpful
val output = String(outputStream.toByteArray(), Charsets.UTF_8)

from kotlin-csv.

doyaaaaaken avatar doyaaaaaken commented on June 19, 2024 1

@Thijsiez Good solution!! Thanks!

from kotlin-csv.

yamin8000 avatar yamin8000 commented on June 19, 2024

Sorry, this library supports output formats only as java.io.File or OutputStream.

The preference of only outputting to a File or OutputStream seems somewhat opinionated or even questionable to me.
It can be beneficial to output directly to a String like when you want to send data in Android to other apps or share data using Intent or hell this library is so easy to use and usable one can use it for raw-printing database records in logs or a TextView for testing purposes or even usable in back-end programming and you just want to respond to an API call with a CSV representation of some data records from the database, that's just my two cents.
For now, I can live with writing to a temporary file in the cache and read that same file so I can have it as a String.

from kotlin-csv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.