Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Incomplete
-
2.11.0
-
None
-
None
Description
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.
private final List<byte[]> buffers = new ArrayList<>();
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