Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Java NIO  RSS feed

 
sarah Marsh
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Is Java NIO a popular mechanism nowadays?
Any other mechanism better than this one?

Thanks!
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sarah Marsh wrote:
Is Java NIO a popular mechanism nowadays?


I'm not sure how one would determine if it were popular or not. Is it used directly more than the standard java.io classes? Probably not. But the standard java.io classes use it under the covers so if one is using standard java.io, one is also using java.nio, so that would make it very popular.

sarah Marsh wrote:
Any other mechanism better than this one?


How would you define "better"? If you need the functionality that NIO provides (non-blocking sockets, for instance), I don't think there are many alternatives.
 
sarah Marsh
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, Joe.

Is NIO necessary? IO in the newest JDK can handle what NIO need to be used. Am I correct?
 
Rob Spoor
Sheriff
Posts: 20904
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The "old" IO package cannot handle non-blocking reads - you'll need the "new" IO (that's where nio came from) package for that.
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!