The Java Tutorials have been written for JDK 8.Java教程是为JDK 8编写的。Examples and practices described in this page don't take advantage of improvements introduced in later releases and might use technology no longer available.本页中描述的示例和实践没有利用后续版本中引入的改进,并且可能使用不再可用的技术。See Java Language Changes for a summary of updated language features in Java SE 9 and subsequent releases.有关Java SE 9及其后续版本中更新的语言特性的摘要,请参阅Java语言更改。
See JDK Release Notes for information about new features, enhancements, and removed or deprecated options for all JDK releases.有关所有JDK版本的新功能、增强功能以及已删除或不推荐的选项的信息,请参阅JDK发行说明。
The java.io
package contains many classes that your programs can use to read and write data. java.io
包包含许多类,您的程序可以使用这些类来读写数据。Most of the classes implement sequential access streams. 大多数类实现顺序访问流。The sequential access streams can be divided into two groups: those that read and write bytes and those that read and write Unicode characters. 顺序访问流可分为两组:读写字节的访问流和读写Unicode字符的访问流。Each sequential access stream has a speciality, such as reading from or writing to a file, filtering data as its read or written, or serializing an object.每个顺序访问流都有其特殊性,例如读取或写入文件,在读取或写入数据时过滤数据,或序列化对象。
The java.nio.file
package provides extensive support for file and file system I/O. java.nio.file
包为文件和文件系统I/O提供了广泛的支持。This is a very comprehensive API, but the key entry points are as follows:这是一个非常全面的API,但关键的入口点如下:
Path
class has methods for manipulating a path.Path
类具有用于操作路径的方法。Files
class has methods for file operations, such as moving, copy, deleting, and also methods for retrieving and setting file attributes.Files
类具有用于文件操作的方法,例如移动、复制、删除,以及用于检索和设置文件属性的方法。FileSystem
class has a variety of methods for obtaining information about the file system.FileSystem
类有多种方法来获取有关文件系统的信息。More information on NIO.2 can be found on the OpenJDK: NIO project website. 关于NIO.2的更多信息可以在OpenJDK: NIO项目网站上找到。This site includes resources for features provided by NIO.2 that are beyond the scope of this tutorial, such as multicasting, asynchronous I/O, and creating your own file system implementation.本站点包含NIO.2提供的超出本教程范围的功能的资源,如多播、异步I/O和创建您自己的文件系统实现。