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
NullPointerExceptionto be thrown.
Warning: Deserialization of untrusted data is inherently dangerous and should be avoided. Untrusted data should be carefully validated according to the "Serialization and Deserialization" section of the Secure Coding Guidelines for Java SE.
Interface Summary Interface Description CloseableA
Closeableis a source or destination of data that can be closed.
DataInputinterface provides for reading bytes from a binary stream and reconstructing from them data in any of the Java primitive types.
DataOutputinterface 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. FlushableA
Flushableis a destination of data that can be flushed.
ObjectInputObjectInput extends the DataInput interface to include the reading of objects. ObjectInputFilterFilter classes, array lengths, and graph metrics during deserialization. ObjectInputFilter.FilterInfoFilterInfo provides access to information about the current object being deserialized and the status of the
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 Class Description BufferedInputStreamA
BufferedInputStreamadds functionality to another input stream-namely, the ability to buffer the input and to support the
BufferedOutputStreamThe class implements a buffered output stream. BufferedReaderReads text from a character-input stream, buffering characters so as to provide for the efficient reading of characters, arrays, and lines. BufferedWriterWrites text to a character-output stream, buffering characters so as to provide for the efficient writing of single characters, arrays, and strings. ByteArrayInputStreamA
ByteArrayInputStreamcontains 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. ConsoleMethods to access the character-based console device, if any, associated with the current Java virtual machine. 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
FileInputStreamobtains input bytes from a file in a file system.
FileOutputStreamA file output stream is an output stream for writing data to a
Fileor to a
FilePermissionThis class represents access to a file or directory. FileReaderReads text from character files using a default buffer size. FileWriterWrites text to character files using a default buffer size. FilterInputStreamA
FilterInputStreamcontains 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
LineNumberInputStream Deprecated.This class incorrectly assumes that bytes adequately represent characters. LineNumberReaderA buffered character-input stream that keeps track of line numbers. ObjectInputFilter.ConfigA utility class to set and get the system-wide filter or create a filter from a pattern string. 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 programmatic 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
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
PrintStreamadds functionality to another output stream, namely the ability to print representations of various data values conveniently.
PrintWriterPrints formatted representations of objects to a text-output stream. PushbackInputStreamA
PushbackInputStreamadds functionality to another input stream, namely the ability to "push back" or "unread" bytes, by storing pushed-back bytes in an internal buffer.
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
SequenceInputStreamrepresents the logical concatenation of other input streams.
SerializablePermissionThis class is for Serializable permissions. StreamTokenizerThe
StreamTokenizerclass takes an input stream and parses it into "tokens", allowing the tokens to be read one at a time.
StringBufferInputStream Deprecated.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.
Enum Summary Enum Description ObjectInputFilter.StatusThe status of a check on the class, array length, number of references, depth, and stream size.
Exception Summary Exception Description 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. UncheckedIOExceptionWraps an
IOExceptionwith an unchecked exception.
UnsupportedEncodingExceptionThe Character Encoding is not supported. UTFDataFormatExceptionSignals that a malformed string in modified UTF-8 format 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.
Error Summary Error Description IOErrorThrown when a serious I/O error has occurred.