mirror of
https://github.com/Snailclimb/JavaGuide
synced 2025-06-16 18:10:13 +08:00
Update io-basis.md
This commit is contained in:
parent
5c7206fc8e
commit
966b48779c
@ -80,7 +80,7 @@ String result = new String(bufferedInputStream.readAllBytes());
|
|||||||
System.out.println(result);
|
System.out.println(result);
|
||||||
```
|
```
|
||||||
|
|
||||||
`DataInputStream` 用于读取指定类型数据,不能单独使用,必须结合 `FileInputStream` 。
|
`DataInputStream` 用于读取指定类型数据,不能单独使用,必须结合其它流,比如 `FileInputStream` 。
|
||||||
|
|
||||||
```java
|
```java
|
||||||
FileInputStream fileInputStream = new FileInputStream("input.txt");
|
FileInputStream fileInputStream = new FileInputStream("input.txt");
|
||||||
@ -138,7 +138,7 @@ FileOutputStream fileOutputStream = new FileOutputStream("output.txt");
|
|||||||
BufferedOutputStream bos = new BufferedOutputStream(fileOutputStream)
|
BufferedOutputStream bos = new BufferedOutputStream(fileOutputStream)
|
||||||
```
|
```
|
||||||
|
|
||||||
**`DataOutputStream`** 用于写入指定类型数据,不能单独使用,必须结合 `FileOutputStream`
|
**`DataOutputStream`** 用于写入指定类型数据,不能单独使用,必须结合其它流,比如 `FileOutputStream` 。
|
||||||
|
|
||||||
```java
|
```java
|
||||||
// 输出流
|
// 输出流
|
||||||
|
Loading…
x
Reference in New Issue
Block a user