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.