Category: 12. Java NIO
-
FileLock
As we know that Java NIO supports concurrency and multi threading which enables it to deal with the multiple threads operating on multiple files at same time.But in some cases we require that our file would not get share by any of thread and get non accessible. For such requirement NIO again provides an API…
-
CharSet
In Java for every character there is a well defined unicode code units which is internally handled by JVM.So Java NIO package defines an abstract class named as Charset which is mainly used for encoding and decoding of charset and UNICODE. Standard charsets The supported Charset in java are given below. Important methods of Charset…
-
AsynchronousFileChannel
As we know that Java NIO supports concurrency and multi-threading which allows us to deal with different channels concurrently at same time.So the API which is responsible for this in Java NIO package is AsynchronousFileChannel which is defined under NIO channels package.Hence qualified name for AsynchronousFileChannel is java.nio.channels.AsynchronousFileChannel. AsynchronousFileChannel is similar to that of the NIO’s…
-
File
Java NIO package provide one more utility API named as Files which is basically used for manipulating files and directories using its static methods which mostly works on Path object. As mentioned in Path tutorial that Path interface is introduced in Java NIO package during Java 7 version in file package.So this tutorial is for…
-
Path
As name suggests Path is the particular location of an entity such as file or a directory in a file system so that one can search and access it at that particular location. Technically in terms of Java, Path is an interface which is introduced in Java NIO file package during Java version 7,and is…
-
Pipe
In Java NIO pipe is a component which is used to write and read data between two threads.Pipe mainly consist of two channels which are responsible for data propagation. Among two constituent channels one is called as Sink channel which is mainly for writing data and other is Source channel whose main purpose is to…
-
Selector
As we know that Java NIO supports multiple transaction from and to channels and buffer.So in order to examine one or more NIO Channel’s, and determine which channels are ready for data transaction i.e reading or writing Java NIO provide Selector. With Selector we can make a thread to know that which channel is ready…
-
Buffer
Buffers in Java NIO can be treated as a simple object which act as a fixed sized container of data chunks that can be used to write data to channel or read data from channel so that buffers act as endpoints to the channels. It provide set of methods that make more convenient to deal…
-
Gather
As we know that Java NIO is a more optimized API for data IO operations as compared to the conventional IO API of Java.One more additional support which Java NIO provides is to read/write data from/to multiple buffers to channel.This multiple read and write support is termed as Scatter and Gather in which data is…
-
Scatter
As we know that Java NIO is a more optimized API for data IO operations as compared to the conventional IO API of Java.One more additional support which Java NIO provides is to read/write data from/to multiple buffers to channel.This multiple read and write support is termed as Scatter and Gather in which data is…