1、 外文原文 11: The Java I/O System Creating a good input/output (I/O) system is one of the more difficult tasks for the language designer. This is evidenced by the number of different approaches. The challenge seems to be in covering all eventualities. Not only are there different sources and sinks of I/
2、O that you want to communicate with (files, the console, network connections), but you need to talk to them in a wide variety of ways (sequential, random-access, buffered, binary, character, by lines, by words, etc.). The Java library designers attacked this problem by creating lots of classes. In f
3、act, there are so many classes for Javas I/O system that it can be intimidating at first (ironically, the Java I/O design actually prevents an explosion of classes). There was also a significant change in the I/O library after Java 1.0, when the original byte-oriented library was supplemented with c
4、har-oriented, Unicode-based I/O classes. As a result there are a fair number of classes to learn before you understand enough of Javas I/O picture that you can use it properly. In addition, its rather important to understand the evolution history of the I/O library, even if your first reaction is “dont bother me with history, just show me how to use it!” The problem is that without the historical perspective you will rapidly become confused with some of the classes and when you should and