Large file transfer over java socket [duplicate]
问题 This question already has answers here : Java multiple file transfer over socket (2 answers) Closed 2 years ago . I have written a small client-server code for transferring small file. It uses Data output stream and readFully() method of data input stream. This code does not work for larger files for obvious reasons. I was thinking of fragmenting large files into smaller chunks of 1Kb each before sending them to client. But I can't think of any solution (like how to write multiple chunks on