alluxio icon indicating copy to clipboard operation
alluxio copied to clipboard

Remove redundant arguments from ByteBuffer read API

Open dbw9580 opened this issue 1 year ago • 1 comments

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.

dbw9580 avatar Apr 12 '23 12:04 dbw9580