NIO Tutorials, Java nio tutorial, Java nio package tutorial

Learn java nio package from our example code.

NIO Tutorials, Java nio tutorial, Java nio package tutorial

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:

  1. java.nio
  2. java.nio.channels
  3. java.nio.channels.spi
  4.  java.nio.charset
  5.  java.nio.charset.spi
  6. java.util.regex

Here are the features of NIO API:

  1. It provides the buffers for data of primitive types
  2. It provides Charcter-set encoders and decoders
  3. The support for Perl-style pattern matching using regular expressions
  4. It introduces the Channels, which a new primitive I/O abstraction
  5. A file interface supporting locks and memory mapping
  6. 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:

  1. Buffers
  2. Charsets
  3. Channels
  4. java.nio.channels.spi

NIO Examples:

Here is the links of NIO tutorials.

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.