Java Reference
In-Depth Information
Waiting for reading to be finished...
228 bytes read from rainbow.txt
Read data is:
My heart leaps up when I behold
A Rainbow in the sky
So was it when my life began;
So is it now I am a man;
So be it when I shall grow old,
Or let me die!
The Child is father of the man;
And I could wish my days to be
Summary
The New Input/Output 2 (NIO.2) is a new I/O API that provides improved, comprehensive support for working with
platform-dependent file systems. An instance of the FileSystem class represents a platform-dependent file system.
An instance of the Path class represents an abstract pathname in the file system. It contains several methods to
manipulate a path. A Path is used with a utility class called Files to work with the contents and attributes of the file
that it represents. The Files class consists of all static convenience methods to work with files, such as for deleting,
copying, and moving files.
NIO.2 has extensive support for reading and modifying file attributes. Attribute support is provided through
different attribute views. Some views are supported on all platforms and some are platform specific. Some views are
optional.
NIO.2 provides a watch service to watch for changes in a directory's contents. The Java program registers a
directory with the watch service to get notified for specific events that occur in the directory, such as the creation of a
new file/directory, change in the contents of a file, deletion of a file, etc. The watch service notifies the Java program
when the event of interest occurs on the registered directories.
NIO.2 provides comprehensive support for asynchronous file I/O. An instance of the java.nio.channels.
AsynchronousFileChannel class represents an asynchronous file channel that is used to read, write, and perform
other operations on a file asynchronously. Multiple I/O operations can be performed simultaneously on an
asynchronous file channel.
 
Search WWH ::




Custom Search