I have been working on the development of a simple server - client application with the use of sockets. So far, both sides use a BufferedReader
for the input stream and a PrintWriter
for the output stream.
This works great so far as I am able to send simple messages from the client to the server and vice versa. I have tried to implement an additional functionality which allows the server and the client to exchange files between them. I've gone through some online tutorials and from what I've gathered using a DataInputStream
and DataOutputStream
is probably ideal for that purpose.
My question is, what would the most appropriate way to implement this be, so that my server and client are able to exchange both messages and files?