Character Streams

After you know how to handle byte streams, you have most of the skills needed to handle character streams as well. Character streams are used to work with any text that is represented by the ASCII character set or Unicode, an international character set that includes ASCII.

Examples of files that you can work with through a character stream are plain text files, HTML documents, and Java source files.

The classes used to read and write these streams are all subclasses of Reader and Writer. These should be used for all text input instead of dealing directly with byte streams.

Note

The techniques for handling character streams were greatly improved after Java 1.0 with the introduction of the Reader and Writer classes and their ...

Get Sams Teach Yourself Java 2 in 21 Days, Second Edition 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.