Creating a good input/output (I/O) system is a more difficult task for designers who build a language.
A large number of different existing solutions have already explained this. The challenge seems to come from covering all possibilities. Not only
I/O source and acceptor (file, console, network connection, etc.) for communication, and also need to be different
To communicate with them (sequential, random access, buffering, binary, by character, by line, by word, etc ).
Java class library designers solve this problem by creating a large number of classes. At the beginning, Java I/O
The system provides so many classes that it is overwhelmed (the irony is that the original intention of Java I/O design is
Avoid too many classes ). Java I/O class libraries have changed significantly since Java 1.0.
Added character-oriented and Unicode-based classes to byte classes. In jdk1.4, the NIO class is added (
The name "New I/O" will be used several years from now) to improve performance and functionality. Therefore
We need to learn a considerable number of classes before fully understanding the Java I/O system to make proper use of it. In addition, it is mandatory
To understand the evolution of the I/O class library, even if our first response is "Don't disturb me with history, just tell me how
." The problem is that, without a historical perspective, we will soon be able to determine when to use certain classes and when
They should not be used and confused.
The knowledge involved includes data storage, Java Io streams, views, object sets, and so on.
Java file (jar)
The zip format is also applied to the jar (Java archive) file format. This file format is the same as zip.
Compress a group of files into a single compressed file. Like anything else in Java, Jar files are cross-platform,
Therefore, you do not have to worry about cross-platform issues. Sound and image files can be included like class files.
Jar files are very useful, especially when it involves Internet applications. If the JAR file is not used, the Web browser
To download all the files that constitute an application, you must repeatedly request the Web server for multiple times. And all these files are
Is not compressed. If you merge all these files into a jar file, you only need to send it once to the remote server.
Request. At the same time, because of the compression technology, the transmission time can be shorter. In addition, for security reasons
Each entry in the file can be added with a digital signature.
A jar file consists of a group of compressed files and a "file list" describing all these files ". (Yes
Create a file list by yourself, which can also be automatically generated by the jar program ). In the JDK document, you can find
More information about the list.