A
Arash Nikkar
I am trying to build a simple application which can be used much like a
ftp application, where the user will drag files over, and it will be
uploaded to a server. So I have spent the last day trying to figure out
the best/most efficient way to do this, and I have in a sense come up
with the following 3 choices
1. Create a client/server connection, transfer files using a
DataOutputStream, which means each file transfer will need to be split
into 2 main parts, the first is the pass the filename, the second is to
actually send the file (obviously this will be split into smaller
pieces as well)
2. This option is the same as above, but it would use NIO with
FileChannel and SocketChannel (something I haven't quite figured out
yet)
3. The last way would be to use an ObjectOutputStream, and keep the
File object information intact, which would make writing the file to
the server, and maintaining directory hierarchy much easier. However,
I'm pretty sure this would yield the slowest transfer rates.
I was wondering if anyone had any suggestions? Better yet, if someone
had an example of a client/server transfer using NIO & FileChannel.
your guidance is appreciated
ftp application, where the user will drag files over, and it will be
uploaded to a server. So I have spent the last day trying to figure out
the best/most efficient way to do this, and I have in a sense come up
with the following 3 choices
1. Create a client/server connection, transfer files using a
DataOutputStream, which means each file transfer will need to be split
into 2 main parts, the first is the pass the filename, the second is to
actually send the file (obviously this will be split into smaller
pieces as well)
2. This option is the same as above, but it would use NIO with
FileChannel and SocketChannel (something I haven't quite figured out
yet)
3. The last way would be to use an ObjectOutputStream, and keep the
File object information intact, which would make writing the file to
the server, and maintaining directory hierarchy much easier. However,
I'm pretty sure this would yield the slowest transfer rates.
I was wondering if anyone had any suggestions? Better yet, if someone
had an example of a client/server transfer using NIO & FileChannel.
your guidance is appreciated