img
Console
ObjectInputStream
Reader
DataInputStream
ObjectInputStream.GetField
SequenceInputStream
DataOutputStream
ObjectOutputStream
SerializablePermission
File
ObjectOutputStream.PutField
StreamTokenizer
FileDescriptor
ObjectStreamClass
StringReader
FileInputStream
ObjectStreamField
StringWriter
FileOutputStream
OutputStream
Writer
FilePermission
OutputStreamWriter
FileReader
PipedInputStream
Console was added by Java SE 6.
The java.io package also contains two deprecated classes that are not shown in the
preceding table: LineNumberInputStream and StringBufferInputStream. These classes
should not be used for new code.
The following interfaces are defined by java.io:
Closeable
FileFilter
ObjectInputValidation
DataInput
FilenameFilter
ObjectOutput
DataOutput
Flushable
ObjectStreamConstants
Externalizable
ObjectInput
Serializable
As you can see, there are many classes and interfaces in the java.io package. These include
byte and character streams, and object serialization (the storage and retrieval of objects). This
chapter examines several of the most commonly used I/O components. The new Console class
is also examined. We begin our discussion with one of the most distinctive I/O classes: File.
File
Although most of the classes defined by java.io operate on streams, the File class does not.
It deals directly with files and the file system. That is, the File class does not specify how
information is retrieved from or stored in files; it describes the properties of a file itself. A
File object is used to obtain or manipulate the information associated with a disk file, such
as the permissions, time, date, and directory path, and to navigate subdirectory hierarchies.
Files are a primary source and destination for data within many programs. Although
there are severe restrictions on their use within applets for security reasons, files are still a
central resource for storing persistent and shared information. A directory in Java is treated
simply as a File with one additional property--a list of filenames that can be examined by
the list( ) method.
The following constructors can be used to create File objects:
File(String directoryPath)
File(String directoryPath, String filename)
File(File dirObj, String filename)
File(URI uriObj)
Search WWH :
Custom Search
Previous Page
Java SE 6 Topic Index
Next Page
Java SE 6 Bookmarks
Home