Skip to content

Commit

Permalink
More correct usage of ByteBuffer APIs when using underlying array.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbordet committed Oct 16, 2023
1 parent 7f25a6b commit ec63688
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public Input.Chunk read() throws IOException {
// TODO: the chunks can be pooled.
Input.Chunk chunk = new Chunk();
ByteBuffer byteBuffer = chunk.byteBuffer();
int read = inputStream.read(byteBuffer.array(), byteBuffer.arrayOffset(), byteBuffer.remaining());
int read = inputStream.read(byteBuffer.array(), byteBuffer.arrayOffset() + byteBuffer.position(), byteBuffer.remaining());
if (read < 0) {
chunk.release();
return Input.Chunk.EOF;
Expand Down

0 comments on commit ec63688

Please sign in to comment.