auto commit
This commit is contained in:
parent
ce9e38d7ec
commit
ac620968a6
@ -98,7 +98,7 @@ Java I/O 使用了装饰者模式来实现。以 InputStream 为例,
|
|||||||
- FileInputStream 是 InputStream 的子类,属于具体组件,提供了字节流的输入操作;
|
- FileInputStream 是 InputStream 的子类,属于具体组件,提供了字节流的输入操作;
|
||||||
- FilterInputStream 属于抽象装饰者,装饰者用于装饰组件,为组件提供额外的功能。例如 BufferedInputStream 为 FileInputStream 提供缓存的功能。
|
- FilterInputStream 属于抽象装饰者,装饰者用于装饰组件,为组件提供额外的功能。例如 BufferedInputStream 为 FileInputStream 提供缓存的功能。
|
||||||
|
|
||||||
<div align="center"> <img src="pics/DP-Decorator-java.io.png" width="500"/> </div><br>
|
<div align="center"> <img src="pics/9bae24e9-d2f5-4e1d-af42-1a868a5847cf.jpg"/> </div><br>
|
||||||
|
|
||||||
实例化一个具有缓存功能的字节流对象时,只需要在 FileInputStream 对象上再套一层 BufferedInputStream 对象即可。
|
实例化一个具有缓存功能的字节流对象时,只需要在 FileInputStream 对象上再套一层 BufferedInputStream 对象即可。
|
||||||
|
|
||||||
|
BIN
docs/notes/pics/9bae24e9-d2f5-4e1d-af42-1a868a5847cf.jpg
Normal file
BIN
docs/notes/pics/9bae24e9-d2f5-4e1d-af42-1a868a5847cf.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 66 KiB |
BIN
docs/pics/9bae24e9-d2f5-4e1d-af42-1a868a5847cf.jpg
Normal file
BIN
docs/pics/9bae24e9-d2f5-4e1d-af42-1a868a5847cf.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 66 KiB |
Loading…
x
Reference in New Issue
Block a user