Skip to content

Commit

Permalink
GH-41717: [Java][Vector] fix issue with ByteBuffer rewind in MessageS…
Browse files Browse the repository at this point in the history
…erializer (#41718)

### Rationale for this change

### What changes are included in this PR?

#41717 describes issue and change

### Are these changes tested?

CI build

### Are there any user-facing changes?

* GitHub Issue: #41717

Authored-by: PJ Fanning <[email protected]>
Signed-off-by: David Li <[email protected]>
  • Loading branch information
pjfanning authored May 20, 2024
1 parent 11decbc commit 1cd2872
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 1cd2872

Please sign in to comment.