magazine resources subscribe about advertising

New Architect Daily
Commentary and updates on current events and technologies

CMP Media E-Book

Download your copy today.

Research
Search for reports and white papers from industry vendors and analysts.

This Week at NewArchitect.com Subscribe now to our free email newsletter and get notified when the site is updated with new articles







Day of Defeat Online Gaming

 New Architect > Archives > 1997 > 07 > Java Alley  

IO Streams in Java 1.1

By Bruce Eckel

The Java 1.0 IO streams library may have left you scratching your head, wondering if any IO stream design could be odder or require more typing to create a new stream. If so, prepare yourself: Java 1.1 will take these musings to a higher level. The new version includes significant modifications to the IO stream library, and although some aspects of the original stream library are deprecated (their use generates a compiler warning), the old streams have been left in for backward compatibility. New classes have been put into the old hierarchy, so JavaSoft is obviously not abandoning the old streams, and "bridge" classes have been added to allow the use of classes in the old hierarchy with those in the new hierarchy: InputStreamReader converts an InputStream to a Reader and OutputStreamWriter converts an OutputStream to a Writer. As a result, you sometimes have more layers of wrapping with the new IO stream library than with the old.

The most important reason for adding the Reader and Writer hierarchies in Java 1.1 is internationalization. The old IO stream hierarchy supports only 8-bit byte streams, and doesn't handle the 16-bit Unicode characters very well. Since Unicode is used for internationalization (and Java's native char is 16-bit Unicode), the Reader and Writer hierarchies were added to support Unicode in all IO operations. In addition, the new libraries are designed for faster operations than the old.

This month, I'll examine features new to the IO streams library, including the new compression library and object serialization.




  Day of Defeat Online Gaming

home | daily | current issue | archives | features | critical decisions | case studies | expert opinion | reviews | access | industry events | newsletter | research | careers | info centers | advertising | subscribe | subscriber service | editorial calendar | press | contacts


Copyright © 2006 CMP Media, LLC Read our privacy policy, your California privacy rights, terms of service.
SDMG Web sites: BYTE.com, C/C++ Users Journal, Developer Pipeline, Dr. Dobb's Journal, DotNetJunkies, MSDN Magazine, Sys Admin,
SD Expo, SD Magazine, SqlJunkies, The Perl Journal, Unixreview, Windows Developer Network, New Architect

web2