Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to convert a OutputStream into a string  RSS feed

 
Tony Evans
Ranch Hand
Posts: 598
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working with a method which that returns a OutputStream, how can I convert it into a String.

Thanks Tony
 
Sprucerz Wizians
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi friend,

try using <objectname>.toString();
if this doesn't work, try posting your code

cheers
Sprucerz
 
Tony Evans
Ranch Hand
Posts: 598
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks will give it a try.

Tony
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Calling anOutputStream.toString() is just going to give you a String like "FileOutputStream@9839873", which isn't what he wants.

In any case, give us a bit more of an explanation. There are certainly ways of doing what you probably want, but before we tell you anything, we'll need to know which of several possibilities it is that you're after.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!