Reader Wrappers

There is the usual variety of wrapper classes that can wrap a Reader, shown in the Figure 17-4.

Figure 17-4. Wrapping the Reader classes

image

Classes that wrap readers

The classes that wrap a Reader are:

  • BufferedReader. This class can provide a performance boost, and also has a readLine() method. The BufferedReader needs to wrap the class that actually accesses the data (e.g., the FileReader or whatever). Other classes may be layered on top of the BufferedReader, too.

  • FilterReader. You subclass FilterReader, and your overriding methods allow you to see and modify individual characters as they come in—before the rest ...

Get Just Java™ 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.