You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2021/01/30 18:11:00 UTC

[jira] [Commented] (IO-706) TimedOutputStream/TimedInputStream

    [ https://issues.apache.org/jira/browse/IO-706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17275683#comment-17275683 ] 

Gary D. Gregory commented on IO-706:
------------------------------------

[~belugabehr]

Great suggestion. The way to do this within Commons IO is with an input stream observed. I added a specialization you can try in git master like this:

{code:java}

final TimetampedObserver timetampedObserver = new TimetampedObserver(); 
try (final ObservableInputStream inputStream = 
        new ObservableInputStream(...), timetampedObserver)) { 
   ... 
} 
System.out.printf("IO duration: %s%n", timetampedObserver.getOpenToCloseDuration());

{code}

 

> TimedOutputStream/TimedInputStream 
> -----------------------------------
>
>                 Key: IO-706
>                 URL: https://issues.apache.org/jira/browse/IO-706
>             Project: Commons IO
>          Issue Type: New Feature
>          Components: Streams/Writers
>            Reporter: David Mollitor
>            Priority: Major
>
> Create a {{FilterInputStream}} {{FilterOutputStream}} that records the time it was opened (instantiated) and the time it was closed.  Add method to return the delta so that users can request the amount of time required to read from (or write to) the underlying Stream.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)