Append InputStream object to String object
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/309424/read-convert-an-inputstream-to-a-string">Read/convert an InputStream to a String</a>  </p>
</blockquote>



<p>I'm trying to append data from a InputStream object to a string as follows:</p>

<pre><code>byte[] buffer = new byte[8192];
InputStream stdout;
String s = "";      
while(IsMoreInputDataAvailable()) {
    int length = this.stdout.read(buffer);
    s += new String(this.buffer, 0, length, "ASCII");
</code></pre>

<p>Is there an easier way of doing this without using Apache or such libraries?</p>
