JavaTM 2 Platform
Std. Ed. v1.4.2

Package java.io

Provides for system input and output through data streams, serialization and the file system.

See:
          Description

Interface Summary
DataInputThe DataInput interface provides for reading bytes from a binary stream and reconstructing from them data in any of the Java primitive types.
DataOutputThe DataOutput interface provides for converting data from any of the Java primitive types to a series of bytes and writing these bytes to a binary stream.
ExternalizableOnly the identity of the class of an Externalizable instance is written in the serialization stream and it is the responsibility of the class to save and restore the contents of its instances.
FileFilterA filter for abstract pathnames.
FilenameFilterInstances of classes that implement this interface are used to filter filenames.
ObjectInputObjectInput extends the DataInput interface to include the reading of objects.
ObjectInputValidationCallback interface to allow validation of objects within a graph.
ObjectOutputObjectOutput extends the DataOutput interface to include writing of objects.
ObjectStreamConstantsConstants written into the Object Serialization Stream.
SerializableSerializability of a class is enabled by the class implementing the java.io.Serializable interface.
 

Class Summary
BufferedInputStreamA BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the input and to support the mark and reset methods.
BufferedOutputStreamThe class implements a buffered output stream.
BufferedReaderRead text from a character-input stream, buffering characters so as to provide for the efficient reading of characters, arrays, and lines.
BufferedWriterWrite text to a character-output stream, buffering characters so as to provide for the efficient writing of single characters, arrays, and strings.
ByteArrayInputStreamA ByteArrayInputStream contains an internal buffer that contains bytes that may be read from the stream.
ByteArrayOutputStreamThis class implements an output stream in which the data is written into a byte array.
CharArrayReaderThis class implements a character buffer that can be used as a character-input stream.
CharArrayWriterThis class implements a character buffer that can be used as an Writer.
DataInputStreamA data input stream lets an application read primitive Java data types from an underlying input stream in a machine-independent way.
DataOutputStreamA data output stream lets an application write primitive Java data types to an output stream in a portable way.
FileAn abstract representation of file and directory pathnames.
FileDescriptorInstances of the file descriptor class serve as an opaque handle to the underlying machine-specific structure representing an open file, an open socket, or another source or sink of bytes.
FileInputStreamA FileInputStream obtains input bytes from a file in a file system.
FileOutputStreamA file output stream is an output stream for writing data to a File or to a FileDescriptor.
FilePermissionThis class represents access to a file or directory.
FileReaderConvenience class for reading character files.
FileWriterConvenience class for writing character files.
FilterInputStreamA FilterInputStream contains some other input stream, which it uses as its basic source of data, possibly transforming the data along the way or providing additional functionality.
FilterOutputStreamThis class is the superclass of all classes that filter output streams.
FilterReaderAbstract class for reading filtered character streams.
FilterWriterAbstract class for writing filtered character streams.
InputStreamThis abstract class is the superclass of all classes representing an input stream of bytes.
InputStreamReaderAn InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes them into characters using a specified charset.
LineNumberInputStreamDeprecated. This class incorrectly assumes that bytes adequately represent characters.
LineNumberReaderA buffered character-input stream that keeps track of line numbers.
ObjectInputStreamAn ObjectInputStream deserializes primitive data and objects previously written using an ObjectOutputStream.
ObjectInputStream.GetFieldProvide access to the persistent fields read from the input stream.
ObjectOutputStreamAn ObjectOutputStream writes primitive data types and graphs of Java objects to an OutputStream.
ObjectOutputStream.PutFieldProvide programatic access to the persistent fields to be written to ObjectOutput.
ObjectStreamClassSerialization's descriptor for classes.
ObjectStreamFieldA description of a Serializable field from a Serializable class.
OutputStreamThis abstract class is the superclass of all classes representing an output stream of bytes.
OutputStreamWriterAn OutputStreamWriter is a bridge from character streams to byte streams: Characters written to it are encoded into bytes using a specified charset.
PipedInputStreamA piped input stream should be connected to a piped output stream; the piped input stream then provides whatever data bytes are written to the piped output stream.
PipedOutputStreamA piped output stream can be connected to a piped input stream to create a communications pipe.
PipedReaderPiped character-input streams.
PipedWriterPiped character-output streams.
PrintStreamA PrintStream adds functionality to another output stream, namely the ability to print representations of various data values conveniently.
PrintWriterPrint formatted representations of objects to a text-output stream.
PushbackInputStreamA PushbackInputStream adds functionality to another input stream, namely the ability to "push back" or "unread" one byte.
PushbackReaderA character-stream reader that allows characters to be pushed back into the stream.
RandomAccessFileInstances of this class support both reading and writing to a random access file.
ReaderAbstract class for reading character streams.
SequenceInputStreamA SequenceInputStream represents the logical concatenation of other input streams.
SerializablePermissionThis class is for Serializable permissions.
StreamTokenizerThe StreamTokenizer class takes an input stream and parses it into "tokens", allowing the tokens to be read one at a time.
StringBufferInputStreamDeprecated. This class does not properly convert characters into bytes.
StringReaderA character stream whose source is a string.
StringWriterA character stream that collects its output in a string buffer, which can then be used to construct a string.
WriterAbstract class for writing to character streams.
 

Exception Summary
CharConversionExceptionBase class for character conversion exceptions.
EOFExceptionSignals that an end of file or end of stream has been reached unexpectedly during input.
FileNotFoundExceptionSignals that an attempt to open the file denoted by a specified pathname has failed.
InterruptedIOExceptionSignals that an I/O operation has been interrupted.
InvalidClassExceptionThrown when the Serialization runtime detects one of the following problems with a Class.
InvalidObjectExceptionIndicates that one or more deserialized objects failed validation tests.
IOExceptionSignals that an I/O exception of some sort has occurred.
NotActiveExceptionThrown when serialization or deserialization is not active.
NotSerializableExceptionThrown when an instance is required to have a Serializable interface.
ObjectStreamExceptionSuperclass of all exceptions specific to Object Stream classes.
OptionalDataExceptionException indicating the failure of an object read operation due to unread primitive data, or the end of data belonging to a serialized object in the stream.
StreamCorruptedExceptionThrown when control information that was read from an object stream violates internal consistency checks.
SyncFailedExceptionSignals that a sync operation has failed.
UnsupportedEncodingExceptionThe Character Encoding is not supported.
UTFDataFormatExceptionSignals that a malformed UTF-8 string has been read in a data input stream or by any class that implements the data input interface.
WriteAbortedExceptionSignals that one of the ObjectStreamExceptions was thrown during a write operation.
 

Package java.io Description

Provides for system input and output through data streams, serialization and the file system. Unless otherwise noted, passing a null argument to a constructor or method in any class or interface in this package will cause a NullPointerException to be thrown.

Related Documentation

For overviews, tutorials, examples, guides, and tool documentation, please see:

Since:
JDK1.0

JavaTM 2 Platform
Std. Ed. v1.4.2

Submit a bug or feature
For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.

Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.