Replace new byte[] full copes with ByteBufUtil.getBytes

Description

We already do it in some places, but we still got plenty of code which does the equivalent of

byte[] packet = new byte[response.readableBytes()]; response.readBytes(packet);

This can be simplified and also made faster (it will call into unsafe code that avoids zeroe-ing out the array using an intrinsic) by using ByteBufUtil.getBytes in netty

Environment

None

Gerrit Reviews

None

Release Notes Description

None

Activity

Show:
Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Story Points

Fix versions

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created January 13, 2020 at 2:09 PM
Updated February 20, 2021 at 5:42 AM
Resolved February 20, 2021 at 5:42 AM
Instabug