I have seen many articles/blogs saying that Java NIO is a better solution compared to traditional Java IO.
But today one of my co-worker showed me this blog http://m
NIO is used not because it's faster but because it has better scalability especially there are amounts of clients.
IO (Blocking IO/Stream IO) is usually one thread per connection to get better response to the clients. Suppose you use single thread to (blocking)listen/(blocking)read/process/(blocking)write for all the clients, just like Starbucks serves all the customers in a single window, Starbucks customers (your clients) would get impatient (timeout).
Note you may think about thread pool to avoid huge number of threads drag down your server. While it just like Starbucks lines all the customers into several windows, the customers are still delay because of other's blocking. So that's why one thread per connection is a good choice in tradition java IO programming.
NIO (None Blocking IO/Block IO which one to use) uses Reactor Pattern to handle IO events. In this case, you could use single thread to blocking/listen|read|process|write. Then the clients blocking (waiting period) would not affect each other.
Note both IO and NIO can use multiply-threads to utilize more cpu-resources, more details in Doug lee's introduction.