|
|
|
|
What is a Stream?A stream is a very useful abstraction that exists in a number of environments. A stream conceptually has:
For example:
If you wish to perform I/O in Java (or move data around in memory), then you will use Java Streams Classification of StreamsIn Java, streams may be classified in the following ways:
Input vs OutputDepending on whether the stream is an input stream or an output stream, a program can interact with the stream in the following ways:
Character vs ByteJava separates its stream classes into two types:
Problems were found in JDK 1.0 when using the existing
byte-oriented streams to deal with input and output of internationalized
character sets. Consequently, JDK 1.1 introduced the set
of classes called Note: Don't even think about using the byte-based streams to input or output characters -- they can't handle anything but ISO Latin-1 8-bit bytes. If you did, your code would not be portable to other character sets (and eventually you will be worrying about producing products for the rest of the world!). Other ClassificationsThe set of stream classes is so large that there are also other ways you could classify them:
|
| The page was last updated February 19, 2008 |