Selecting between java.io and java.nio

Hi,I'm a bit confused between java.io and java.nio. What sre the major differences between these two?In areas are these best applicable?
[158 byte] By [rudza] at [2007-11-27 0:24:44]
# 1

The java.nio package improves on the basic Java I/O that was available prior to JDK 1.4.

It is designed to interoperate more natively with the underlying file handles (sockets, open files etc) to achieve better performance.

The improvements include true non-blocking I/O, better buffer management, character-set support, channels (similar to Occam's channels) and selectors, and some other ancillery stuff. Most of these classes are designed to be inherently threadsafe.

There are some examples here:

http://java.sun.com/j2se/1.4.2/docs/guide/nio/example/index.html

However, if you are still a beginner with file or network I/O, its better if you start with the simple I/O first. You'll appreciate the NIO improvements better afterwards.

jbxa at 2007-7-11 22:21:56 > top of Java-index,Core,Core APIs...