alluxio
alluxio copied to clipboard
Remove redundant arguments from ByteBuffer read API
What changes are proposed in this pull request?
Remove redundant offset
and length
arguments of read APIs where a ByteBuffer
(or Netty's ByteBuf
) is used as the output buffer.
Why are the changes needed?
The offset
and length
arguments are commonly found in byte array-based APIs. A ByteBuffer
, however, already has an internal position and a limit that indicates the offset and length of the read call. Passing in redundant arguments poses a risk that the passed in arguments conflict with the ByteBuffer's internal properties, and leads to very subtle bugs.
Does this PR introduce any user facing changes?
No.