Skip to content

Commit

Permalink
Fix issue jetty#5499
Browse files Browse the repository at this point in the history
this PR let the ByteAccumulator recyclable. after invoke ByteAccumulator.transferTo method
we can invoke ByteAccumulator.recycle method to reuse byte[] via ByteAccumulator.newByteArray method

Signed-off-by: Baoyi Chen <chen.bao.yi@qq.com>
  • Loading branch information
chenby committed Oct 28, 2020
1 parent 0b3fd54 commit ccb3582
Showing 1 changed file with 1 addition and 0 deletions.
Expand Up @@ -96,6 +96,7 @@ public void transferTo(ByteBuffer buffer)

void recycle() {
index = 0;
length = 0;
prevChunks = nextChunks;
nextChunks = new ArrayList<>();
}
Expand Down

0 comments on commit ccb3582

Please sign in to comment.