ByteStream problems
<p>I'm having a hard time trying to understand how this code is working. It's using a byte stream:</p>

<pre><code>in = new FileInputStream("xanadu.txt");
out = new FileOutputStream("x.txt");
int c;

while((c = in.read()) != -1) {
    out.write(c);   
}
</code></pre>

<p>What I don't understand is the <code>while</code> loop. Is the input stream working like an array where the index is being incremented, and that index is passed on to the output stream? </p>

<p>If some one could explain it would be greatly be appreciated.</p>
