This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
The end of the stream is just that, the end of the stream. What that means determines on the source.
For local files, the end of the stream is reached when all characters (or bytes with an InputStream) have been read.
For files on a web server or FTP server, the end of the stream is reached when the server says that all characters / bytes have been read. For HTTP (web servers) that is mostly determined by the content-length header.
For sockets, the end of the stream is reached when the other side has closed the connection and everything that has been sent before is read.
For other sources you'll have to check it out.
I am changing my application to initiate the socket close to the server by some EOF indicator chars. In the past, I think the socket was closed initiated by server side when it finished file sending. Now the server side is changed to wait for my application initiation. That is why I have this concern and the question.