I used the code here to send a single file through a socket. However, I need to be able to send multiple files (basically all the files in the directory) through the socket and the client will find out how the separation between the files is. Honestly, I will completely lose what to do. Any advice would be helpful.
NOTE 1: I need a way to send files to one continuous stream, which the client can split into separate files. He cannot rely on separate requests from the client.
NOTE 2: To answer the question, I am sure that I will receive comments, no, this is NOT homework.
EDIT has been suggested that I can send the file size in front of the file itself. How can I do this, since sending a file over a socket is always performed either in a predefined byte array, or in a single byte separately, and not in the long one returned by File.length()
java sockets
ewok
source share