This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Beginning Java and the fly likes Java NIO Tutorial, Java NIO vs. IO, Buffer Basics., direct buffer vs Indirect buffer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java NIO Tutorial, Java NIO vs. IO, Buffer Basics., direct buffer vs Indirect buffer" Watch "Java NIO Tutorial, Java NIO vs. IO, Buffer Basics., direct buffer vs Indirect buffer" New topic
Author

Java NIO Tutorial, Java NIO vs. IO, Buffer Basics., direct buffer vs Indirect buffer

Anish Nath
Greenhorn

Joined: Sep 21, 2011
Posts: 23


In Java programming, I/O has until recently been carried out using a stream metaphor. All I/O is viewed as the movement of single bytes, one at a time, through an object called a Stream. Stream I/O is used for contacting the outside world. It is also used internally, for turning objects into bytes and then back into objects.
NIO has the same role and purpose as original I/O, but it uses a different metaphor -- block I/O. As you will learn in this tutorial, block I/O can be a lot more efficient than stream I/O.
Ivan Jozsef Balazs
Rancher

Joined: May 22, 2012
Posts: 867
    
    5
> In Java programming, I/O has until recently been carried out using a stream metaphor.

You posted this today.

However NIO has been around since version J2SE 1.4 (February 6, 2002)
NIO was extended with Java SE 7 (July 28, 2011).

Java version history
 
Consider Paul's rocket mass heater.
 
subject: Java NIO Tutorial, Java NIO vs. IO, Buffer Basics., direct buffer vs Indirect buffer