A Quick Overview of Stream
The concept of a stream is just that—a continuous stream of bytes, traveling between a program and a file, between two threads, or between two programs. Some I/O classes require the use of sockets. Sockets will be dealt with in Chapter 14, "Java Network Programming." The stream classes in Java, such as FileInputStream, are byte-oriented. They read and write data one byte at a time or in groups of bytes. These are the only kind of classes for I/O in JDK 1.0.
JDK 1.1 introduced Reader and Writer, which are character-based. Internally, Java uses Unicode, 16-bit characters. To write out to a file using, for example, a FileOutputStream, Java formerly had to translate characters from Unicode characters to smaller ASCII characters. ...
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