Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

NIO updated examples  RSS feed

 
Snay It
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,
Can anyone please give me a link to NIO examples in Java 5.0? I tried to find some but for some reason i didn't, and i'm having some issues with translating my code to 5.0.

Thanks,
snayit
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
NIO Examples in the 1.5 documentation.
BTW, the old IO/net classes are not depreciated in the newer API's. There's no need to "translate" your code if you don't need the features of NIO.
 
Snay It
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But i can't even go over the Set of selected keys now! it doesn't allow iterator.remove() so my previous code does not work...

Thanks for the link!
 
Snay It
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmm... the NIO examples in the link are for 1.4... they did not update the examples.
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Snay It:
But i can't even go over the Set of selected keys now! it doesn't allow iterator.remove()


That sounds like a problem with Collections, not NIO. Support for iterator.remove() depends on the underlying collection so it works for some and does not work for others.
As for the examples changing, I don't think there are any substantial changes to NIO between 1.4 and 1.5.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!