Object Serialization

Java handles access to external data via the use of a class of objects called streams. A stream is an object that carries data from one place to another. Some streams carry information from a source into a Java program. Others go the opposite direction and take data from a program to a destination.

A stream that reads a Web page's data into an array in a Java program is an example of the former. A stream that writes a String array to a disk file is an example of the latter.

Two types of streams were introduced during Day 17, "Handling Data Through Java Streams."

  • Byte streams, which read and write a series of integer values ranging from 0 to 255

  • Character streams, which read and write textual data

These streams separate the ...

Get Sams Teach Yourself Java 2 in 21 Days, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.