netty5/codec/src/main/java
Aleksey Yeschenko a2583d0d3c Fix ReflectiveByteBufChecksum with direct buffers (#9244)
Motivation:

ReflectiveByteBufChecksum#update(buf, off, len) ignores provided offset
and length arguments when operating on direct buffers, leading to wrong
byte sequences being checksummed and ultimately incorrect checksum
values (unless checksumming the entire buffer).

Modifications:

Use the provided offset and length arguments to get the correct nio
buffer to checksum; add test coverage exercising the four meaningfully
different offset and length combinations.

Result:

Offset and length are respected and a correct checksum gets calculated;
simple unit test should prevent regressions in the future.
2019-06-17 16:32:12 +02:00
..
io/netty/handler/codec Fix ReflectiveByteBufChecksum with direct buffers (#9244) 2019-06-17 16:32:12 +02:00