spring-projects/spring-framework — pull request #653 by candrews (2014-09-26 19:48:06+00:00)
Title: SPR-12081: Use a more efficient buffer implementation in ShallowEtagHeaderFilter

This PR is composed of 2 commits.

The first commit doesn't change the API of ShallowEtagHeaderFilter so it's safe to use in 4.1.x. It offers an improvement over the current state by eliminating most of the copying and all of the array reallocations.

The second commit changes the API of ShallowEtagHeaderFilter so it probably has to wait for 4.2. It eliminates the creation of the whole response byte[].

I'm sure this PR isn't perfect; I look forward to the comment and discussion. For example, I'm not too thrilled about the "instanceof" check I had to do in DigestUtils in order to do the optimized digest, but I couldn't think of a better way.

Thanks in advance!