Welcome to the NIO Framework Project!

What is NIO?

A new input/output (NIO) library was introduced with Java 1.4. It provides high-speed, block-oriented I/O and takes advantage of low-level optimizations in a way that the original I/O package could not, without using native code.
This is all great, but actually creating network applications with the NIO library has always been very difficult because the paradigm shifted from synchronous to asynchronous I/O. A programmer using NIO suddenly has to deal with a lot of complex new issues, e.g.:

  • incomplete read/write operations
  • data buffering
  • buffer overflows
  • buffer flipping
  • managing channel interest operations
  • queue handling
  • thread pools
  • thread synchronization
  • ...

A programmer first has to take care of all this issues and must implement a lot of boilerplate code just to get a little working NIO network application. The issues are even doubled when you want to use NIO with SSL. Things that have been very simple with the classic I/O (e.g. waiting for an SSL handshake to complete) are now extremely complicated!

What is the NIO Framework?

The NIO Framework is a library on top of NIO that hides most of the complexity of plain NIO. With the NIO Framework you can implement high-performance Java network applications without having to deal with all the nasty details of NIO. The issues above are resolved while the performance is preserved. In addition to that the NIO Framework provides many I/O building blocks for application programmers, e.g.:

  • dummy traffic
  • traffic shaping
  • traffic accounting
  • ...

Take a look at the examples to see how easy it is to use the NIO Framework!

The following paper describes the initial design of the Java NIO Framework: JAVA NIO FRAMEWORK.
It was presented at the 3rd International Conference on Software and Data Technologies ICSOFT 2008.