---
title: "JavaIO中的装饰者模式(Wrapper)"
author: "yzyspy"
date: "2012-10-07T23:06:58Z"
tags: []
categories: ["企业架构"]
slug: "javaio-wrapper"
draft: false
lastmod: "2012-10-13T14:15:09Z"
id: 1692292
url: "https://yzyspy.iteye.com/blog/1692292"
---

DataOutputStream  BufferedOutputStream  FileOutputStream 三个对象之间可以互相组合拼接，在不添加更多子类的情况下，将对象的功能加以拓展。

 

![](http://dl.iteye.com/upload/attachment/0074/6849/034cae5f-d500-3727-985f-d60d1817071a.png)

      BufferedInputStream DataInputStream ...是装饰者；

      FileInputStream是被装饰者