We have seen several times how a basic I/O class can be wrapped or “decorated” by another I/O class of the same parent class. So it should be no surprise that an InputStream can have a BufferedInputStream and/or a subclass of FilterInputStream interposed between the FileInputStream (or other data source) and the DataInputStream.
There is quite a variety of InputStreams that can decorate the basic access classes. Figure 17-5 shows some, but by no means all, of the most popular classes.
Figure 17-5. Classes that wrap InputStreams
You can wrap any or all of the following output streams onto your original InputStream: ...