Line in, while still going?
<p>I have a while loop that goes while a BuffedReader still has data, what the while loop is meant to be doing is reading each line and then continuing on. This is what I have </p>

<pre><code>final BufferedReader in;
....
in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
String line = null
while ((line = in.readLine()) != null) {
    line = line.replace(" ", ",");
    reply.append(line + System.getProperty("line.separator"));
    Log.d("DeviceActivity",  line);
}
</code></pre>

<ul>
<li>Edit </li>
</ul>

<p>This reads the two lines that are expected and then it doesn't finish the loop like it is meant to.</p>

<p>I have tried it with different inputs as well but same result, it doesn't exit the while loop. </p>

<p>Does anyone know how to prevent this?</p>

<p>Also its not always two lines, it could be infinite.</p>
