img
Package
Primary Function
java.text
Formats, searches, and manipulates text.
java.text.spi
Suppor ts ser vice providers for text formatting classes in java.text.
(Added by Java SE 6.)
java.util
Contains common utilities.
java.util.concurrent
Suppor ts the concurrent utilities.
java.util.concurrent.atomic Suppor ts atomic (that is, indivisible) operations on variables without
the use of locks.
java.util.concurrent.locks
Suppor ts synchronization locks.
java.util.jar
Creates and reads JAR files.
java.util.logging
Suppor ts logging of information related to a program's execution.
java.util.prefs
Encapsulates information relating to user preference.
java.util.regex
Suppor ts regular expression processing.
java.util.spi
Suppor ts ser vice providers for the utility classes in java.util.
(Addded by Java SE 6.)
java.util.zip
Reads and writes compressed and uncompressed ZIP files.
TABLE 27-1
The Core Java API Packages (continued)
NIO
A relatively new addition to Java is called NIO (New I/O), and it is one of the more interesting
packages because it supports a channel-based approach to I/O operations. The NIO classes
are contained in the five packages shown here:
Package
Purpose
java.nio
Top-level package for the NIO system. Encapsulates various types
of buf fers that contain data operated upon by the NIO system.
java.nio.channels
Suppor ts channels, which are essentially open I/O connections.
java.nio.channels.spi
Suppor ts ser vice providers for channels.
java.nio.charset
Encapsulates character sets. Also suppor ts encoders and decoders
that conver t characters to bytes and bytes to characters, respectively.
java.nio.charset.spi
Suppor ts ser vice providers for character sets.
Before we begin, it is important to emphasize that the NIO subsystem is not intended to
replace the I/O classes found in java.io, which are discussed in Chapter 19. Instead, the
NIO classes supplement the standard I/O system, giving you an alternative approach,
which can be beneficial in some circumstances.
NIO Fundamentals
The NIO system is built on two foundational items: buffers and channels. A buffer holds data.
A channel represents an open connection to an I/O device, such as a file or a socket. In general,
to use the NIO system, you obtain a channel to an I/O device and a buffer to hold data. You
then operate on the buffer, inputting or outputting data as needed. The following sections
examine buffers and channels in more detail.
Search WWH :
Custom Search
Previous Page
Java SE 6 Topic Index
Next Page
Java SE 6 Bookmarks
Home