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 the O’Reilly learning platform.

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