Reading a file into a CharBuffer, then a StringBuilder or StringBuffer seems to leave out on parts of the file. Why?
<p>The following code seems to only write a small part of the File in the StringBuilder - why?</p>

<pre><code>    Reader rdr = new BufferedReader(new InputStreamReader(new FileInputStream(...)));
    StringBuilder buf = new StringBuilder();
    CharBuffer cbuff = CharBuffer.allocate(1024);
    while(rdr.read(cbuff) != -1){
        buf.append(cbuff);
        cbuff.clear();
    }
    rdr.close();
</code></pre>

<p>Some more information: The file is bigger than the CharBuffer, also i can see from the debugger that the charbuffer is indeed filled as expected. The only part that makes its way to the StringBuilder seems to be from somewhere in the middle of the file. I am using openJDK7.
I wonder why it would show such a behavior and how this can be fixed.</p>
