What is a Stream?
A stream is a sequence of data of undetermined length. It's called a stream because it's like a stream of water that continues to flow. There's no definite end to it.
Input and Output in Java
The [Link] package contains classes that perform input and output. In Java, I/O classes are differentiated according to the type of data being read or written. Byte oriented and numeric data is written with output streams and read with input streams. Character data, that is text, is written with writers and read with readers. Whether you use streams or readers and writers depends on the type of data you're dealing with. All text data, especially non-ASCII text, should be passed through a reader or writer. The two main stream classes are [Link] and [Link]. The two main reader and writer classes are [Link] [Link] These are abstract base classes for many different subclasses with more specialized abilities.
The Stream Classes
Most stream classes are part of the [Link] package. (There are also a few more in the [Link] and [Link] packages, but those are deliberately hidden from you. There are also a couple in [Link].) The two main classes are [Link] and [Link]. These are abstract base classes for many different subclasses with more specialized abilities, including:
BufferedInputStream BufferedOutputStream ByteArrayInputStream ByteArrayOutputStream DataInputStream DataOutputStream FileInputStream FileOutputStream FilterInputStream FilterOutputStream LineNumberInputStream ObjectInputStream
ObjectOutputStream PipedInputStream PipedOutputStream PrintStream PushbackInputStream SequenceInputStream StringBufferInputStream