The examples in the following table show how to use the NIO APIs.
Source File Description
Searches a list of files for lines that match a given regular-expression pattern. Demonstrates NIO mapped byte buffers, charsets, and regular expressions.
Computes 16-bit checksums for a list of files. Uses NIO mapped byte buffers for speed.
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.
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.
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.
Implements a non-blocking Internet time server.
Copyright © 1993, 2011, Oracle and/or its affiliates. All rights reserved.