IT. Expert System.

Java Standard Edition (SE)

NIO and NIO.2 Examples


NIO and NIO.2 Examples

The examples in the following table show how to use the NIO APIs.
Source File Description
Grep.java Searches a list of files for lines that match a given regular-expression pattern. Demonstrates NIO mapped byte buffers, charsets, and regular expressions.
Sum.java Computes 16-bit checksums for a list of files. Uses NIO mapped byte buffers for speed.
TimeQuery.java Asks a list of hosts what time it is. Is a simple, blocking program that demonstrates NIO socket channels (connection and reading), buffer handling, charsets, and regular expressions.
TimeServer.java Listens for connections and tells callers what time it is. Is a simple, blocking program that demonstrates NIO socket channels (accepting and writing), buffer handling, charsets, and regular expressions.
Ping.java Connects to each of a list of hosts and measures the time required to complete the connection. Uses a selector and two additional threads to demonstrate non-blocking connects and the multithreaded use of a selector.
NBTimeServer.java Implements a non-blocking Internet time server.

The NIO.2 examples in the following table can be accessed in your JDK 7 installation under <JAVA_HOME>/sample/nio.

Source File Description
file/Chmod.java Changes the permissions of files in a manner similar to the chmod(1) utility.
file/Copy.java Copies files in a manner similar to the cp(1) utility.
file/DiskUsage.java Prints out disk space information similar to the df(1M) utility.
file/FileType.java Prints out a file's type.
file/WatchDir.java Watches a directory (or tree) for changes to files.
file/Xdd.java Lists, gets, and deletes the user-defined attributes of a file.
multicast/MulticastAdress.java Parses and represents a multicast address.
multicast/Reader.java Reads a message from a multicast datagram.
multicast/Sender.java Sends a message in a multicast datagram to a given group.
server/README.txt This directory contains a simple NIO-based HTTP/HTTPS server example. See the README.txt file for further information.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 666 / . Delta: 0.04452 с