Most applications need to process some input and produce some output based on that input.
The purpose of the Java IO package (java.io
) is to make that possible in Java.
大多數的應用往往需要訪問一些輸入,并且根據輸入來產生相應的輸出。Java IO包使這一切在java中變得可能。
If you look at the Java IO classes in the java.io
package the vast amount
of choices can be rather confusing. What is the purpose of all these classes? Which one
should you choose for a given task? How do you create your own classes to plugin? etc.
The purpose of this tutorial is to try to give you an overview of how all these classes
are grouped, and the purpose behind them, so you don't have to wonder whether you chose
the right class, or whether a class already exists for your purpose.
本教程的目標就是希望通過本教程對于IO的概述,可以對如何選擇一個恰當的類,某一個既定類是否滿足你的需求做出判斷。
The Scope of the Java IO (java.io) Package
The java.io
package doesn't actually address all types of input and output.
For instance, input from and output to a GUI or web page is not covered in the Java IO package.
Those types of input are covered elsewhere, for instance by the JFC classes in the Swing project,
or the Servlet and HTTP packages in the Java Enterprise Edition.
The Java IO package is primarily focused on input and output to files, network streams, internal memory buffers etc.
事實上,java.io包并不能解決所有類型的輸入、輸出。比如說,基于GUI和web頁面的輸入、輸出就不在java.io包的處理范圍內。這些類型的輸入、輸出在其他方面比如Swing里面的JFC類,Servlet,java企業版里面的HTTP包被解決。Java IO包主要關注文件的輸入、輸出,網絡流以及內存緩沖等。
The Scope of this Java IO Tutorial
Below is a table of contents of the topics and classes covered in this tutorial. The coverage
of the classes is not just an API listing. You can get that from Sun's official Java Doc's.
Rather each text is a short introduction to the class, its purpose, and a few examples
of how to use it. In other words, some of the stuff you don't find in Sun's official Java Doc's.
下面的表格列出了本教程中涵蓋的內容標題和類,這不僅僅是一個API的list。