[
https://issues.apache.org/jira/browse/IO-752?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Gary D. Gregory closed IO-752.
------------------------------
Resolution: Incomplete
Closing, no PR.
> Use LinkedList in org.apache.commons.io.output.AbstractByteArrayOutputStream
> ----------------------------------------------------------------------------
>
> Key: IO-752
> URL: https://issues.apache.org/jira/browse/IO-752
> Project: Commons IO
> Issue Type: Improvement
> Components: Streams/Writers
> Affects Versions: 2.11.0
> Reporter: Vladimír Váša
> Priority: Minor
>
> Hi,
> org.apache.commons.io.output.AbstractByteArrayOutputStream is super class
> which
> (unlike java.io.ByteArrayOutputStream)
> not realocate memory/copy arrays - if data buffer is groving.
> Instead of it use List of 1KB byte[] chunks and simply add new chunk into
> list.
> {color:#cc7832}private final
> {color}List{color:#9876aa}<{color}{color:#cc7832}byte{color}{color:#9876aa}[]>
> {color}{color:#9876aa}buffers {color}= {color:#cc7832}new
> {color}ArrayList{color:#9876aa}<>(){color}{color:#cc7832};{color}
> But as List implementation there is used "ArrayList" so the "array of
> pointers to chunks" is stil realocated in memory.
> I suggest to use LinkedList instead.
> With best regards
> Vladimir Vasa
--
This message was sent by Atlassian Jira
(v8.20.1#820001)