Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

输入和输出: 读、写和目录技巧 #38

Open
YuezhenQin opened this issue Feb 18, 2024 · 0 comments
Open

输入和输出: 读、写和目录技巧 #38

YuezhenQin opened this issue Feb 18, 2024 · 0 comments
Assignees

Comments

@YuezhenQin
Copy link
Owner

YuezhenQin commented Feb 18, 2024

  1. 引言
    大多数程序都需要与外部世界交互,最常用的一种做法就是通过读写文件。文件通常被存储在某种持久介质上,如磁盘。大多数情况下,我们往往会忽略不同操作系统、不同存储设备上文件之间的区别。对现在来说,它们都只是文件。另外,与其他语言和操作系统类似,Java 将读写模型扩展到了网络通信。

2.对读写的支持
InputStream/OutputStream/Reader/Writer, 这些是读写文件的传统方式,从 Java 1.0 以来基本没有发生改变。而现代 Java 又提供了一个新的类: java.nio.file.Files。该类和 java.nio.file.Path 一起提供了很多功能,包括如何处理文件和如何处理目录。

所有现代操作系统都提供了组织文件的方法,可以将一组文件组织到文件夹目录中。

Formatter 和 Scanner 类提供了格式化和扫描操作,实现对读写数据的格式加以控制。
%d
%f

@YuezhenQin YuezhenQin converted this from a draft issue Feb 18, 2024
@YuezhenQin YuezhenQin self-assigned this Feb 18, 2024
@YuezhenQin YuezhenQin moved this from In Progress to Todo in dsa-in-java Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

1 participant