tags:

views:

55

answers:

1

I implemented a multi-file gatherer input stream which is able to read and combine data from previously scattered file segments. However, the current version uses RandomAccessFile along with fixed size ExecutorService, and with lots of CPU overhead. I'd like to avoid these I/O threads and perform a single threaded Selector based approach. Unfortunately, FileChannel (or JDK7's Path.newByteChannel()) is not selectable. Is there a way to do this data-gather in an NIO way?

A: 

Look at jdk7's AsynchronousFileChannel.

Alan