Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ResizableByteArrayOutputStream and ByteArrayOutputStream capacities [SPR-11594] #16218

spring-projects-issues opened this issue Mar 24, 2014 · 1 comment
status: backported type: enhancement


Copy link

@spring-projects-issues spring-projects-issues commented Mar 24, 2014

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:

  • #12919 ShallowEtagHeaderFilter should make use of specified content length

Referenced from: commits dbd5f67, dd7f54c

Backported to: 3.2.9

Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Mar 24, 2014

Juergen Hoeller commented

The ByteArrayOutputStream capacities are to be backported to 3.2.9 as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
status: backported type: enhancement
None yet

No branches or pull requests

2 participants