server can't receive eof in java
<pre><code>FileOutputStream fos = new FileOutputStream(fileName);
InputStream is = clientSocket.getInputStream();
while ((readBytes = is.read()) != -1)
{
    fos.write(readBytes);
    System.err.println(readBytes);
}
System.err.println(readBytes);
clientSocket.shutdownOutput();
fos.close();
System.out.println("Trans complete");
</code></pre>

<p>client sends -1, but server can't receive -1</p>

<p><strong>how can I get all file</strong>?</p>
