ResizableByteArrayOutputStream and ByteArrayOutputStream capacities [SPR-11594] #16218
Labels
status: backported
An issue that has been backported to maintenance branches
type: enhancement
A general enhancement
Milestone
Juergen Hoeller opened SPR-11594 and commented
As part of the resolution of #12919, we introduced a ResizableByteArrayOutputStream class. For general use, this class should be designed as an actual subclass of ByteArrayOutputStream, just with a higher initial capacity and with its public grow and resize operations.
At the same time, we should revisit all our use of ByteArrayOutputStream and consistenly specify appropriate initial capacities there, analogous to our use of ResizableByteArrayOutputStream. ByteArrayOutputStream's default of 32 bytes would just lead to pointless copying when growing the internal byte array... In almost all cases, 256 or even 1024 is appropriate.
Affects: 3.2.8, 4.0.2
Issue Links:
Referenced from: commits dbd5f67, dd7f54c
Backported to: 3.2.9
The text was updated successfully, but these errors were encountered: