Get an OutputStream into a String : Java

This one of the most common issue that developers are running into and solution is so simple.

We can use a ByteOutputStream for this solution.

 ByteOutputStream baos = new ByteOutputStream(b);
 String output = new String( baos.toByteArray());  

Comments