码迷,mamicode.com
首页 > 编程语言 > 详细

Java NIO Tutorial

时间:2014-11-20 09:06:32      阅读:220      评论:0      收藏:0      [点我收藏+]

标签:style   http   io   ar   color   os   sp   java   for   


Java Nio 

1Java NIO Tutorial
2Java NIO Overview
3Java NIO Channel
4Java NIO Buffer
5Java NIO Scatter / Gather
6Java NIO Channel to Channel Transfers
7Java NIO Selector
8Java NIO FileChannel
9Java NIO SocketChannel
10Java NIO ServerSocketChannel
11Java NIO DatagramChannel
12Java NIO Pipe
13Java NIO vs. IO

Java NIO Tutorial

bubuko.com,布布扣 
By Jakob Jenkov
 Connect with me: 
Rate article:
Share article:

Java NIO (New IO) is an alternative IO API for Java (from Java 1.4), meaning alternative to the standard Java IO andJava Networking API‘s. Java NIO offers a different way of working with IO than the standard IO API‘s.

Java NIO: Channels and Buffers

In the standard IO API you work with byte streams and character streams. In NIO you work with channels and buffers. Data is always read from a channel into a buffer, or written from a buffer to a channel.

Java NIO: Non-blocking IO

Java NIO enables you to do non-blocking IO. For instance, a thread can ask a channel to read data into a buffer. While the channel reads data into the buffer, the thread can do something else. Once data is read into the buffer, the thread can then continue processing it. The same is true for writing data to channels.

Java NIO: Selectors

Java NIO contains the concept of "selectors". A selector is an object that can monitor multiple channels for events (like: connection opened, data arrived etc.). Thus, a single thread can monitor multiple channels for data.

How all this works is explained in more detail in the next text in this series - the Java NIO overview.







Java NIO Tutorial

标签:style   http   io   ar   color   os   sp   java   for   

原文地址:http://blog.csdn.net/opengl_es/article/details/41307637

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!