相对于初学者,I/O中的每个类都是重点,尽管有的一些不常用,但还是要了解之,不然很难明白其真正底层的东西,java已经够面向对象了,你如果不了解它里面的一些机理,那就更加抽象了。等到你真正想用它写点东西的时候有可能会茫然,或者方法匮乏。所以建议把文档通看一下,虽然很多,但是有好处^_^。当然如果你是从业人士,如果你说那样会花很多冤枉的时间,那我无言以对。下面是摘自thinking in java的一段,希望对你在思想上有所帮助:
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/O that you want to communicate with (files, the console, network connections, etc.), 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 fact, there are so many classes for Java’s 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 char-oriented, Unicode-based I/O classes. In JDK 1.4, the nio classes (for “new I/O,” a name we’ll still be using years from now) were added for improved performance and functionality. As a result, there are a fair number of classes to learn before you understand enough of Java’s I/O picture that you can use it properly. In addition, it’s rather important to understand the evolution history of the I/O library, even if your first reaction is “don’t 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 shouldn’t use them.
[此贴子已经被作者于2005-8-16 12:53:52编辑过]