I'm writing a multithreaded server in Java. The server transfers files from/to clients. A requirement of the project is to use NIO to handle files.
Since the server is multithreaded, I'm not using SocketChannels for the communication, instead I'm using simple Sockets.
To meet the NIO requirement, I'm forced to use FileChannels to read from / write to files. Now the question is: does it make sense to transfer files between a FileChannel and something that isn't a channel (like a simple Socket)? Do I have to switch to SocketChannels?
I'm asking this because I've always seen that transfers like these are always made between two channels, so I was a little dubious about it.