Skip to content

Commit

Permalink
apacheGH-41717: [Java][Vector] fix issue with ByteBuffer rewind in Me…
Browse files Browse the repository at this point in the history
…ssageSerializer (apache#41718)

### Rationale for this change

### What changes are included in this PR?

apache#41717 describes issue and change

### Are these changes tested?

CI build

### Are there any user-facing changes?

* GitHub Issue: apache#41717

Authored-by: PJ Fanning <[email protected]>
Signed-off-by: David Li <[email protected]>
  • Loading branch information
pjfanning authored and vibhatha committed May 25, 2024
1 parent 8dd38cd commit 7e4b151
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,8 @@ public static MessageMetadataResult readMessage(ReadChannel in) throws IOExcepti
throw new IOException(
"Unexpected end of stream trying to read message.");
}
messageBuffer.rewind();
// see https://github.com/apache/arrow/issues/41717 for reason why we cast to java.nio.Buffer
ByteBuffer rewindBuffer = (ByteBuffer) ((java.nio.Buffer) messageBuffer).rewind();

// Load the message.
Message message = Message.getRootAsMessage(messageBuffer);
Expand Down

0 comments on commit 7e4b151

Please sign in to comment.