13 Streams and Files
13.1 INTRODUCTION
A stream is a sequence of bytes. When data is received by some device (e.g., a keyboard to the program), the stream is termed as input stream and when data is sent by the program to the output device (e.g., a screen), the stream is termed as output stream. A stream provides a sort of abstraction as will be seen. All streams behave in the same manner whether data come from some device (e.g., from a keyboard or from some network socket). Similar argument applies for output stream. It behaves the same for screen, network socket or any other output device. We have mentioned in all the earlier programs that for printing something onto the screen we have made use of System.out.println . Similarly for taking ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access