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

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

                Author: ASF GitHub Bot
            Created on: 19/Feb/21 17:41
            Start Date: 19/Feb/21 17:41
    Worklog Time Spent: 10m 
      Work Description: jmark109 commented on pull request #206:
URL: https://github.com/apache/commons-io/pull/206#issuecomment-782228140


   @garydgregory Yes, I see that. I don't think these failures have anything to 
do with my changes. Looks like some type of misconfiguration with the build. I 
see errors like this:
   ```
   java.lang.IllegalAccessError: class 
org.apache.commons.io.input.BufferedFileChannelInputStream (in unnamed module 
@0x685f4c2e) cannot access class sun.nio.ch.DirectBuffer (in module java.base) 
because module java.base does not export sun.nio.ch to unnamed module 
@0x685f4c2e
   ```
   I did not touch that class. I only added one new method to 
`DeferredFileOutputStream` so it should not affect any other tests.
   
   When I build locally everything works fine.


----------------------------------------------------------------
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:
[email protected]


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

    Worklog Id:     (was: 554845)
    Time Spent: 40m  (was: 0.5h)

> 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: 40m
>  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