Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@frgomes
Created January 17, 2018 16:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frgomes/d074cd48904f023ee0c4d676a68c2a9a to your computer and use it in GitHub Desktop.
Save frgomes/d074cd48904f023ee0c4d676a68c2a9a to your computer and use it in GitHub Desktop.
Scala - Create java.io.InputStream from String
val lines =
Seq(
"Item,Qty,Price",
"Banana,1,0.50")
val text = lines.mkString("\n")
val stream: java.io.InputStream = new java.io.ByteArrayInputStream(text.getBytes(java.nio.charset.StandardCharsets.UTF_8.name))
@hlopezvg-appgate
Copy link

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment