commons-io ProxyInputStream,ProxyOutputStream,ProxyReader,ProxyWriter

1.ProxyInputStream:

A Proxy stream which acts as expected, that is it passes the method calls on to the proxied stream and doesn't change which methods are being called.

It is an alternative base class to FilterInputStream to increase reusability, because FilterInputStream changes the methods being called, such as read(byte[]) to read(byte[], int, int).

See the protected methods for ways in which a subclass can easily decorate a stream with custom pre-, post- or error processing functionality.

翻译:

处理字节。

一个代理stream,作用:将方法调用传递给proxy stream并且不改变被调用的方法。

FilterInputStream改变被调用方法的状态,ProxyInputStream增加FilterInputStream的可重用性。

子类通过实现pre-,post-,error等方法可以很方便的装饰ProxyInputStream。

 

2.ProxyReader:

处理字符。

其他同上。

 

3.ProxyOutputStream

同ProxyInputStream。

4.ProxyWriter

同ProxyReader

 

posted @ 2016-11-14 17:18  WanderingAlbatross  阅读(255)  评论(0编辑  收藏  举报