[ 
https://issues.apache.org/jira/browse/IO-211?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jukka Zitting updated IO-211:
-----------------------------

    Attachment: IO-211.patch

Attached a proposed patch that adds such protected hook methods and adapts some 
of the existing stream decorator classes to use those hooks. The implementation 
is quite similar to that of the handleIOException() method we added already 
earlier.

This change adds the overhead of two method calls to each read and write 
method, but I don't see that as a problem as any performance-sensitive client 
will use the reasonably sized buffers so the extra methods are only called once 
every n bytes read or written.


> Pre- and post-processing support for proxied streams
> ----------------------------------------------------
>
>                 Key: IO-211
>                 URL: https://issues.apache.org/jira/browse/IO-211
>             Project: Commons IO
>          Issue Type: New Feature
>          Components: Streams/Writers
>            Reporter: Jukka Zitting
>            Priority: Minor
>         Attachments: IO-211.patch
>
>
> In many cases a stream decorator needs to add custom pre- or post-processing 
> functionality to all the read and write methods in decorated input and output 
> streams. For example the CountingInputStream needs to override all three 
> read() methods with similar code.
> It would be nice if the proxy stream classes provided simple hooks for adding 
> such functionality.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to