I am trying to send a file from one computer to another using Java. I have written the code below, it works fine if both sender and receiver are started in the same computer
Remember that in.read(buffer) not necessarily fills up the whole buffer with new data. Therefore you should make sure you don't write the whole buffer. Change