java NIO系列:Java NIO Tutorial
来源:互联网 发布:推介算法 编辑:程序博客网 时间:2024/06/03 05:14
Java NIO Tutorial
Jakob Jenkov
Last update: 2014-06-25
Java NIO (New IO) is an alternative IO API for Java (from Java 1.4), meaning alternative to the standardJava IO and Java 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系列:Java NIO Tutorial
- Java NIO Tutorial
- Java NIO Tutorial
- Java NIO Tutorial
- Java NIO Tutorial
- Java NIO Tutorial
- Java NIO Tutorial
- Java NIO Tutorial 2- Java NIO Overview
- Java NIO Tutorial 3- Java NIO Channel
- 【JAVA】【NIO】1、Java NIO Tutorial
- The Rox Java NIO Tutorial
- Java NIO Tutorial 1- Introduction
- Java NIO 系列:Java NIO Path
- java NIO 系列:Java NIO Files
- java NIO系列: Java NIO AsynchronousFileChannel
- Java NIO系列教程
- Java NIO系列教程
- Java NIO系列
- Why we need StackOverFlow?
- android主题与样式
- java NIO系列:Java NIO: Non-blocking Server
- TouchEvent(2)
- C++考试复习(2):c++标识符和命名规则
- java NIO系列:Java NIO Tutorial
- 多节点服务器定时任务重复处理的问题
- CISCO SNMPv3 配置及snmpwalk命令信息获取
- 《Java数据结构与算法》笔记-CH5-链表-5用双端链表实现队列
- 制作时钟cocos3.0
- 《Java数据结构与算法》笔记-CH5-链表-6实现有序链表
- python opencv(1) 显示图像
- MySQL触发器简单使用
- HDU 1020 Encoding