• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java 5 new features with I/O?

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, I haven't used Java since 2002 and as of lately, I have been getting back into it because I have a chance to actually use it at work.

I was asking a Java guy at work what has changed with 5.0 besides generics and enum's? He told me the I/O stuff has changed. That you have to use listener classes for reading/writing data over sockets or files now.

This didn't make sense to me at all and I kept asking him what he meant because I looked at the java.io package and I didn't see anything really "new" in it when it came to reading/writing. He was trying to explain it to me, but I guess I'm just not getting it.

Does anyone know what he meant? What else is new in Java 5 besides generics and enum's?
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the JavaRanch.
Your "Java" guy is confused. The standard java.io classes are still there. The "New" IO classes, which add some useful features have been in the J2SE since 2002 and don't replace as much as enhance the standard classes.
Maybe he's thinking about java.util.Scanner.?
For the full list of Java 5.0 enhancements, see here
 
Dean Jones
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Joe!

He said it had something to do with Threads and I/O. Does that make anymore sense at all?
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The only thing I can think of that deals with threads is the non-blocking IO introduced in the "new" IO classes (see here). Again, this has been part of the J2SE for years and doesn't preclude using the standard IO classes.
 
Dean Jones
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah... I'm willing to bet that's what he was talking about. Is Selecting new in Java, or just part of the NIO? Cause it's been around in C for quite some time now..
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It was "new" to Java in 1.4, as part of NIO. It was eagerly anticipated in a few key niches precisely because it was well-known in C, and java.io classes don't support high-volume concurrency that well. But for most applications, the NIO stuff isn't necessary, and it's a bit more complex to deal with. Nowadays the IO classes generally use NIO under the hood anyway, so often you get the same result either way. But a Selector is one key feature that you just can't do with the older API.
[ December 13, 2006: Message edited by: Jim Yingst ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic