Skip to content

Commit d8819d3

Browse files
authored
Update io-design-patterns.md
1 parent 4e5f88d commit d8819d3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/java/io/io-design-patterns.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ static final class RunnableAdapter<T> implements Callable<T> {
215215
工厂模式用于创建对象,NIO 中大量用到了工厂模式,比如 `Files` 类的 `newInputStream` 方法用于创建 `InputStream` 对象(静态工厂)、 `Paths` 类的 `get` 方法创建 `Path` 对象(静态工厂)、`ZipFileSystem` 类(`sun.nio`包下的类,属于 `java.nio` 相关的一些内部实现)的 `getPath` 的方法创建 `Path` 对象(简单工厂)。
216216

217217
```java
218-
InputStream is Files.newInputStream(Paths.get(generatorLogoPath))
218+
InputStream is = Files.newInputStream(Paths.get(generatorLogoPath))
219219
```
220220

221221
## 观察者模式
@@ -318,4 +318,4 @@ class PollingWatchService
318318
- 装饰器模式:通过剖析 Java IO 类库源码学习装饰器模式:https://time.geekbang.org/column/article/204845
319319
- sun.nio 包是什么,是 java 代码么? - RednaxelaFX https://www.zhihu.com/question/29237781/answer/43653953
320320

321-
<!-- @include: @article-footer.snippet.md -->
321+
<!-- @include: @article-footer.snippet.md -->

0 commit comments

Comments
 (0)