Working with the Stream Classes

The java.io package provides different input and output streams for reading and writing data. There are also two separate sets of stream classes. Prior to JDK 1.1, the input and output classes only supported 8-bit byte streams. Starting with JDK 1.1, 16-bit Unicode character streams were also being supported. This was very important because character streams have these important characteristics:

  • They can deal with any character in the Unicode set.

  • They use buffering internally.

  • Internationalization is easier because they don't rely on a specific encoding.

The byte and character streams are really a distinct set of classes. Most of the functionality for byte streams is located in the base InputStream and OutputStream ...

Get Special Edition Using Java 2 Standard 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.