[ 
https://issues.apache.org/jira/browse/IO-651?focusedWorklogId=555872&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-555872
 ]

ASF GitHub Bot logged work on IO-651:
-------------------------------------

                Author: ASF GitHub Bot
            Created on: 22/Feb/21 15:57
            Start Date: 22/Feb/21 15:57
    Worklog Time Spent: 10m 
      Work Description: coveralls edited a comment on pull request #206:
URL: https://github.com/apache/commons-io/pull/206#issuecomment-782224839


   
   [![Coverage 
Status](https://coveralls.io/builds/37332860/badge)](https://coveralls.io/builds/37332860)
   
   Coverage increased (+0.1%) to 89.383% when pulling 
**99f52c851f263e12da83982d001db190331643d8 on 
jmark109:IO-651_DeferredFileOutputStream_getInputStream** into 
**5833b831ffe2bf8cdb74ee5567c8ae33abb0c7f4 on apache:master**.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 555872)
    Time Spent: 3h 50m  (was: 3h 40m)

> Provide method to retrieve data from DeferredFileOutputStream as InputStream
> ----------------------------------------------------------------------------
>
>                 Key: IO-651
>                 URL: https://issues.apache.org/jira/browse/IO-651
>             Project: Commons IO
>          Issue Type: Improvement
>          Components: Streams/Writers
>    Affects Versions: 2.6
>            Reporter: John Mark
>            Priority: Major
>              Labels: easyfix, performance, pull-request-available
>          Time Spent: 3h 50m
>  Remaining Estimate: 0h
>
> It would be very helpful to have to {{toInputStream()}} method on the 
> {{DeferredFileOutputStream}} class. Besides for convenience, it would allow 
> for improved efficiency since in the case of in-memory data the byte buffer 
> would not need to be copied (as opposed to the current {{getData()}} method). 
> The implementation is pretty simple and can be something like the following 
> (based on the current {{writeTo(OutputStream)}} method):
> {code:java}
> public InputStream toInputStream() throws IOException {
>     if (!closed) {
>         throw new IOException("Stream not closed");
>     }
>     if (isInMemory()) {
>         return memoryOutputStream.toInputStream();
>     } else {
>         return Files.newInputStream(outputFile.toPath());
>     }
> }
> {code}



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

Reply via email to