NIO Tutorial - Java NIO Tutorials
In this section we will discuss about the Sun java nio package. This nio tutorials will help you learn nio package with examples. We are providing many examples on the Java nio package here. You can download and use the examples to learn and explore the java nio package.
NIO Package:
The java.nio package was first included in the JDK 1.4 to help the programmer to write fast programs. This package is part of JDK 1.5 and JDK 1.6 also. It provides improved performance in buffer management, scalable network and file I/O, character-set support and the regular-expression matching. The sub packages of the java.nio package are:
- java.nio
- java.nio.channels
- java.nio.channels.spi
- java.nio.charset
- java.nio.charset.spi
- java.util.regex
Here are the features of NIO API:
- It provides the buffers for data of primitive types
- It provides Charcter-set encoders and decoders
- The support for Perl-style pattern matching using regular expressions
- It introduces the Channels, which a new primitive I/O abstraction
- A file interface supporting locks and memory mapping
- Support for multiplexed, non-blocking I/O for writing scalable servers
The NIO API provides many useful abstraction classes to better programming. The useful abstraction classes are:
- Buffers
- Charsets
- Channels
- java.nio.channels.spi
NIO Examples:
Here is the links of NIO tutorials.
How to get bytes from ByteBuffer in java.
In this tutorial you will see how to get bytes from ByteBuffer in java.
How to get the capacity of ByteBuffer in java.
In this tutorial you will see how to get the capacity of ByteBuffer in java.
How to compute limit of ByteBuffer in java.
In this tutorial you will see how to compute limit of ByteBuffer in java.
Use of rewind method in java.
In this tutorial you will see use of rewind method in java.
How to clean a buffer using clear method in java.
In this tutorial you will see how to clean a buffer using clear method in java.
Order
bytes from most significant to least significant.
In this tutorial you will learn about how to order bytes from most significant
to least significant.
Order
bytes from least significant to most significant.
In this tutorial you will learn about how to order bytes from least significant
to most significant.
Compare two buffer's content
In this tutorial you will learn about how to compare two buffer's content
Get
the capacity of a buffer
In this tutorial you will learn about how get the capacity of a buffer
How to Create a ByteBuffer using Byte Array in java.
In this tutorial you will see how to Create a ByteBuffer using Byte Array in
java.
How to transfer data from ByteBuffer to byte array in java.
In this tutorial you will see how to transfer data from ByteBuffer to byte array
in java.
How to get specific index value from ByteBuffer in java.
In this tutorial you will see how to get specific index value from ByteBuffer in
java.