I find that every new Java project I'm on, I run into a situation where I want to translate an
InputStream to a
String or vice versa. This is frequently in a unit test where I've read an input file or expected output file in using
getClass().getResourceAsStream() and need to convert to Strings for use in my test.
It's a simple boiler plate task, yet darned if I can remember the most an effecient way to do it every time. I always re-google and always tend to refer to this one to jog my memory..
Thought I'd link out to it this time.
1 comment:
I've used that same example myself. They've also got an example going the reverse direction:
http://www.kodejava.org/examples/265.html
Post a Comment