O’Reilly news

"Java I/O, Second Edition": Mastering the Ins and Outs of Java I/O

May 25, 2006

Sebastopol, CA--Input and output, I/O for short, are fundamental to any computer operating system or programming language. Only theorists find it interesting to write programs that don't require input or produce output. At the same time, I/O hardly qualifies as one of the more "thrilling" topics in computer science. It's something in the background, something you use every day--but for most developers," observes Elliotte Rusty Harold, author of the new second edition of Java I/O (O'Reilly, US $49.99), "it's not a topic with much sex appeal."

But in fact, there are plenty of reasons Java programmers in particular should find I/O interesting. Java includes an especially rich set of I/O classes in the core API. These classes support several different styles of I/O. One distinction is between the old-style stream-based I/O and the new-style channel- and buffer-based I/O. These all have their place and are appropriate for different needs and use cases. None of them should be ignored.

With Java the language of choice for many network applications and servers buckling under demand, system administrators and programmers are clamoring for answers. Java's I/O facilities are extraordinarily flexible and simple to use, and provide everything from simple binary and text output to USB and Bluetooth communication. There's world-class support for internationalization, memory-mapped files, asynchronous I/O, and more. Do you need to encrypt your files and network sockets for privacy and security? CipherInputStream is what you want. Do you desire smaller, more compact output? ZipOutputStream is what you're looking for. Is your network server buckling under the load of many clients? Selectors and channels could be your salvation.

The problem is how best to use those facilities. Harold explains the problem, "After writing my earlier book, 'Java Network Programming,' I noticed that a lot of the questions I got from readers and students in my classes weren't so much about network programming itself as they were about input and output (or I/O in programmer vernacular)."

The new edition of Java I/O addresses these questions and more. When asked why a second edition, Harold replied, "In the seven years since the first edition was released, there've been a lot of new developments in the field: java.nio, the Bluetooth API, USB support, and more. I was really glad to have the opportunity to update the book and bring it into sync with the state of the art as of Java 6 and 2006. The new edition is particularly important now as Java 5 and 6 add some surprising and little-known features to I/O. Among them there's finally a Console class and printf is now supported. File handling is improved as well, though it's still one of Java's weak spots. A lot of these new features haven't had the same attention that java.nio did in 1.4. It's nice to be able to bring a little well-deserved attention to all the hard work that went into I/O in Java 5 and 6."

When Java 1.1 was released with a vastly expanded java.io package and many new I/O classes spread out across the rest of the class library, it became obvious that a book that specifically addressed I/O was required. 'Java I/O' is that book. More specifically, the second edition is that book updated and expanded to cover the even more impressive I/O capabilities introduced in Java 1.4, 5, and 6. The I/O class libraries in Java are more powerful and interesting than ever, and this book shows readers how to take full advantage of them.

Java is the first language to provide a cross-platform I/O library that is powerful enough to handle all the diverse tasks that developers must deal with. Java is the first programming language with a modern, object-oriented approach to input and output. Java's I/O model is more powerful and more suited to real-world tasks than any other major language used today. Java I/O was the first and is still the only book to fully expose the power and sophistication of this library.

Early praise for Java I/O, Second Edition:

"Elliotte Rusty Harold is certainly one of the best writers in computer programming. His attention to detail and care in making his explanations easy to follow are outstanding."
--Bruce Eckel, author of Thinking in Java

Additional Resources:

Java I/O, Second Edition
Elliotte Rusty Harold
ISBN: 0-596-52750-0, 700 pages, $49.99 US, $64.99 CA
1-800-998-9938; 1-707-827-7000

About O’Reilly

O’Reilly Media spreads the knowledge of innovators through its books, online services, magazines, and conferences. Since 1978, O’Reilly Media has been a chronicler and catalyst of cutting-edge development, homing in on the technology trends that really matter and spurring their adoption by amplifying “faint signals” from the alpha geeks who are creating the future. An active participant in the technology community, the company has a long history of advocacy, meme-making, and evangelism.

Email a link to this press release