0 like 0 dislike
27 views
in Computer Science by (1.0m points)
What is stream? Explain different types of streams.

1 Answer

0 like 0 dislike
by (1.0m points)
A stream object may be:

An input stream or an output stream,

a processing stream or an ordinary stream,

a character-oriented stream or a byte-oriented stream,

and may be connected to a variety of sources or destinations.

There are many types of streams. For example, a stream might be an "input, character-oriented, processing stream". Another stream might be an "byte-oriented output stream". Not only are there many types of streams, there are many ways to connect them together. The I/O aspects of a program can get complicated.

This situation is common to all industrial-strength programming languages. I/O is a big topic because of the wide variety of IO devices and the wide variety of data formats. A production language must be able to read data from sources written by any language running on any type of computer.

For example, a program might need to read data from magnetic tapes written 30 years ago by a COBOL program running on an IBM mainframe. (You would likely use byte-oriented streams for this).

Fortunately, if a program is written in Java it will use identical data formats on all computers. If a Java program running on a Macintosh writes a text file, that file can easily be read by a Java program running on a PC or on any other computer.

This is not true of most other languages. A C program running on one type of computer is unlikely to create a file that can easily be read by a C program running on another type of computer. Worse than that, two different C compilers for the same computer might use different data format

Related questions

0 like 0 dislike
1 answer 62 views
0 like 0 dislike
1 answer 28 views
0 like 0 dislike
1 answer 45 views
0 like 0 dislike
1 answer 30 views
0 like 0 dislike
1 answer 103 views
0 like 0 dislike
1 answer 30 views
0 like 0 dislike
1 answer 33 views
0 like 0 dislike
1 answer 30 views
0 like 0 dislike
1 answer 193 views
0 like 0 dislike
1 answer 41 views
Welcome to Free Homework Help, where you can ask questions and receive answers from other members of the community. Anybody can ask a question. Anybody can answer. The best answers are voted up and rise to the top. Join them; it only takes a minute: School, College, University, Academy Free Homework Help

19.4k questions

18.3k answers

8.7k comments

3.3k users

Free Hit Counters
...