Missing and unexpected chars in reading a large input stream using BufferedInputStream in java
<p>I have to do  read an Large InputStream comming from a URL. 
I loaded the InputStream to the <strong>BufferedInputStream</strong> and read it to a <strong>byte[ ]</strong> and I append that byte [] to a StringBuilder converting it to a string. After all data has been appended to the StringBuilder, the resulting String contains some missing and unexpected chars. I didn't use any encoding (Eg. UTF-8) here since the response is coming in the similar format I expected.</p>

<p>Can you give any suggestions to solve this?</p>

<p><strong>Code :</strong> </p>

<pre><code>    BufferedInputStream brIn    = new BufferedInputStream(connection.getInputStream());
    StringBuilder response      = new StringBuilder(1000);

    byte[] byteBfr  = new byte[8192];
    int n=0;

    while((n=brIn.read(byteBfr,0,byteBfr.length)) != -1){
        response.append(new String(byteBfr).toCharArray(),0,n);
    }

    return  response.toString();
</code></pre>

<p><strong>Output :</strong>
This is a part of the resulting response. The complete one contains about 554595 lines.</p>

<p><em>Expected Result :</em></p>

<pre><code>  &lt;Hotel&gt;
    &lt;CiID&gt;31&lt;/CiID&gt;
    &lt;HoID&gt;58617&lt;/HoID&gt;
    &lt;Name&gt;HARRY΄S&lt;/Name&gt;
    &lt;Address&gt;PROTARAS&lt;/Address&gt;
    &lt;Phone&gt;00357 23 834100&lt;/Phone&gt;
    &lt;Fax&gt;0035723831860&lt;/Fax&gt;
    &lt;Stars&gt;3&lt;/Stars&gt;
  &lt;/Hotel&gt;
</code></pre>

<p><em>Actual Result :</em></p>

<pre><code>  &lt;Hotel&gt;
    &lt;CiID&gt;31&lt;/CiID&gt;
    &lt;HoID&gt;58617&lt;/HoID&gt;
    &lt;Name&gt;HARRY΄S&lt;/Name&gt;
    &lt;Address&gt;PROTARAS&lt;/AdAdress&gt;
 &lt;   &lt;Phone&gt;00357 23 834100&lt;/Phone&gt;
    &lt;Fa9x&gt;00390&lt;P654224546&lt;/Fax&gt;
    &lt;Stars&gt;3&lt;/Stars&gt;
  &lt;/Hotel&gt;
</code></pre>

<p>In the above one you can see the unexpected chars in the Address, Fax and in the Phone.</p>
