This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan 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.