| Author |
OutputStream
|
Andy Hahn
Ranch Hand
Joined: Aug 31, 2004
Posts: 225
|
|
Hi, I am using a method that writes it's contents to an output stream. How can I instead capture those contents into a java String? Thanks.
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24056
|
|
|
You can use a ByteArrayOutputStream to collect the data, then use toByteArray() to get the bytes, and then construct a String from them.
|
[Jess in Action][AskingGoodQuestions]
|
 |
 |
|
|
subject: OutputStream
|
|
|