commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rob Reeves (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (IO-549) Make ByteArrayOutputStream.toBufferedInputStream public to avoid a buffer copy
Date Thu, 14 Sep 2017 16:54:00 GMT

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

Rob Reeves commented on IO-549:
-------------------------------

[~garydgregory]
Yes, I will provide a PR for this.

> Make ByteArrayOutputStream.toBufferedInputStream public to avoid a buffer copy
> ------------------------------------------------------------------------------
>
>                 Key: IO-549
>                 URL: https://issues.apache.org/jira/browse/IO-549
>             Project: Commons IO
>          Issue Type: Improvement
>          Components: Streams/Writers
>    Affects Versions: 2.5
>            Reporter: Rob Reeves
>            Priority: Minor
>              Labels: performance
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I'm working on a project where I need to aggregate a lot of data in memory. To do this
I'm using GzipOutputStream backed by org.apache.commons.io.output.ByteArrayOutputStream. After
the aggregation is done I eventually will read the data back out. I'm trying to avoid byte[]
buffer copies to reduce the memory usage. ByteArrayOutputStream.toBufferedInputStream seems
like the perfect way to do this, but it's a private method. I would only call it after I'm
done writing to the ByteArrayOutputStream object. Is there any reason I shouldn't use this
method? Could it be made public? Thanks!



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message