The java.io Package
The original source for much of the information contained herein
about I/O is the javadoc documentation for the
java.io package. You should have downloaded this
with the JDK, but it’s also available
online at:
The class library documentation is, however, woefully incomplete.
While it explains what each method does, it often fails to explain
how, why, or when you should use those methods. Furthermore, it only
occasionally discusses assumptions about the behavior of those
methods—assumptions that are crucial for anyone not merely
using but also subclassing particular classes. There are many
implicit assumptions about what particular methods should do (for
instance, that a close() method of a filter input
stream also closes any other streams it’s connected to), and
these are generally not documented anywhere (or at least they
weren’t until I wrote this book).
I’ve tried to document all of these assumptions in this book,
but if you’re faced with a new class not covered here, the
canonical reference is the source code itself. The JDK includes Java
source code for the java packages. You’ll
find it in a file called src.zip in your JDK distribution. Sometimes the only way to figure out exactly what Sun intended particular classes to do ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access