go to previous page   go to home page   go to next page

Answer:

Yes. For example, a text editor typically does output to both the monitor and to a disk file. Its input comes from both a disk file and the keyboard.


Character Streams and Byte Streams

Character streams are intended exclusively for character data.

Byte streams are intended for general purpose input and output.

Of course, fundamentally all data consist of patterns of bits grouped into 8-bit bytes. So, logically all streams could be called "byte streams." However streams that are intended for bytes that represent characters are called "character streams" and all others are called "byte streams".

Character streams are optimized for character data and perform some other useful character-oriented tasks. Often the source or destination of a character stream is a text file, a file that contains bytes that represent characters.

So far in these chapters, programs have done I/O only with character data. However, data sources and destinations often contain non-character data. For example, the bytecode file created by the Java compiler contains machine instructions for the Java virtual machine. These are not intended to represent characters, and input and output of them must use byte streams.


QUESTION 4:

Think of another type of file that contains data other than characters.


go to previous page   go to home page   go to next page