Java NIO Tutorial
来源:互联网 发布:卷积神经网络算法实现 编辑:程序博客网 时间:2024/06/06 13:18
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 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
- java NIO系列:Java NIO Tutorial
- The Rox Java NIO Tutorial
- Java NIO Tutorial 1- Introduction
- Java NIO 2.0 : Memory-Mapped Files | MappedByteBuffer Tutorial
- Java Tutorial
- Java NIO: NIO概述
- Java NIO:NIO概述
- Java NIO:NIO概述
- Java NIO:NIO概述
- 测试5题
- 张正友相机标定Opencv实现以及标定流程&&标定结果评价&&图像矫正流程解析(附标定程序和棋盘图)
- 区块链主流开源技术体系介绍
- 变化的必然性
- 浅谈C++多态
- Java NIO Tutorial
- SIP相关的RFC文档索引
- 爬虫爬去豆瓣书的目录
- Microservices
- mysql创建utf-8字符集数据库
- 第十九天学习笔记
- Java NIO Overview
- 校验日期格式为yyyy-MM-dd
- 成员变量多态问题