Let’s divide the animals in the stream class zoo by how they are used. There are separate hierarchies for classes that process bytes and characters. As you saw, the
OutputStream classes let you read and write individual bytes and arrays of bytes. These classes form the basis of the hierarchy shown in Figure 1.1. To read and write strings and numbers, you need more capable subclasses. For example,
DataOutputStream let you read and write all the primitive Java types in binary format. Finally, there are streams that do useful stuff; ...