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
leonchen83 committed Oct 29, 2020
1 parent a5d642b commit 95f7c04
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -55,7 +55,7 @@ public void copyChunk(ByteBuffer buffer)

if (length > 0)
{
chunks.add((ByteBuffer) buffer.flip());
chunks.add((ByteBuffer)buffer.flip());
this.length += length;
}
else
Expand Down
Expand Up @@ -198,7 +198,7 @@ int copyChunk(Inflater inflater, ByteAccumulator accumulator, ByteBuffer buf) th
}
position += read;
}
accumulator.copyChunk((ByteBuffer) buf.position(position));
accumulator.copyChunk((ByteBuffer)buf.position(position));
return position;
}

Expand Down

0 comments on commit 95f7c04

Please sign in to comment.