non-blocking I/O
https://en.wikipedia.org/wiki/New_I/O_(Java)
zh.wikipedia.org/wiki/Java_NIO
Java NIO API提供在java.nio套件或其子套件中。
- 緩衝區的基本資料類型
- 字元集的編碼器和解碼器
- 基於Perl風格的正則表達式(在 java.util.regex )
- 通道(Channels),一個新的原生抽象 I/O
- 支援鎖定(Lock)和記憶體映射的檔案介面,檔案Szie最多可以存取到Integer.MAX_VALUE(2GB)
- 多工,非阻塞式I/O的可扩展性伺服器
The APIs of NIO were designed to provide access to the low-level I/O operations of modern operating systems. Although the APIs are themselves relatively high-level, the intent is to facilitate an implementation that can directly use the most efficient operations of the underlying platform.
The Java NIO APIs are provided in the java.nio
package and its subpackages. The documentation by Oracle identifies these features.
- Buffers for data of primitive types
- Character set encoders and decoders
- A pattern-matching facility based on Perl-style regular expressions (in package
java.util.regex
) - Channels, a new primitive I/O abstraction
- A file interface that supports locks and memory mapping of files up to
Integer.MAX_VALUE
bytes (2 GiB) - A multiplexed, non-blocking I/O facility for writing scalable servers