append part of java byte array to StringBuilder
<p>How do I append a portion of byte array to a StringBuilder object under Java?  I have a segment of a function that reads from an InputStream into a byte array.  I then want to append whatever I read into a StringBuilder object:</p>

<pre><code>byte[] buffer = new byte[4096];
InputStream is;
//
//some setup code
//
while (is.available() &gt; 0)
{
   int len = is.read(buffer);
   //I want to append buffer[0] to buffer[len] into StringBuilder at this point
 }
</code></pre>
