Java I/O, NIO, and NIO.2
Java I/O support is included in the java.io and java.nio packages. Together these packages include the following features:
- Input and output through data streams, serialization and the file system.
- Charsets, decoders, and encoders, for translating between bytes and Unicode characters.
- Access to file, file attributes and file systems.
- APIs for building scalable servers using asynchronous or multiplexed, non-blocking I/O.
Tutorials and Programmer's Guides
- The Basic I/O section of The Java Tutorial and, in particular, File I/O (featuring NIO.2)
- Developing a Custom File System Provider
- Zip File System Provider
- Troubleshooting Tips
API Specification
- java.io (description) - Supports system input and output, and object serialization. to the file system
- java.nio (description) - Defines buffers for bulk memory operations. Buffers may be allocated in direct memory for high performance.
- java.nio.channels (description) - Defines channels, an abstraction for devices capable of performing I/O operations; defines selectors for multiplexed, non-blocking I/O
- java.nio.channels.spi (description) - Provides implementations for channels
- java.nio.file - Defines interfaces and classes to access files and file systems.
- java.nio.file.attribute - Defines interfaces and classes for accessing file system attributes.
- java.nio.file.spi - Defines classes for creating a file system implementation.
- java.nio.charset (description) - Defines charsets, decoders, and encoders, for translating between bytes and Unicode characters
- java.nio.charset.spi (description) - Provides implementations for charsets
- com.sun.nio.sctp (description) - A Java API for Stream Control Transport Protocol
Examples
Enhancements
- Enhancements in JDK 8 Release
- Enhancements in JDK 7 Release
- Enhancements in JDK 6 Release
- Enhancements in JDK 5.0 Release
- Enhancements in J2SDK 1.4
- Previous Enhancements