There is a small client-server program, clients can make requests to get a list of files and download them. Now the program normally writes only text files, uses DataInputStream and DataOutputStream . ( FileInputStream and OutputStream respectively).
All the contents of the files are read by the usual FileInputStream , but before they are sent, they are written to a string, which is not good. Which threads are best used to read content records? Provided that we do not know with what type of file will have to work.
And in what form is it better to transfer data via tcp / ip?
BufferedInputStreaminbyte[], then send bytes to the socket. Nothing complicated. - Nofate ♦