David Li created ARROW-9221:
-------------------------------
Summary: ArrowBuf#setBytes(int, ByteBuffer) doesn't check the byte
buffer's endianness
Key: ARROW-9221
URL: https://issues.apache.org/jira/browse/ARROW-9221
Project: Apache Arrow
Issue Type: Bug
Components: Java
Affects Versions: 0.15.1
Reporter: David Li
[https://github.com/apache/arrow/blob/c9c5f5f2e8e8f5db4141d06b6e1841f0a55d905a/java/memory/src/main/java/org/apache/arrow/memory/ArrowBuf.java#L832]
This should check/set the buffer's endianness. This came up while debugging an
issue in Flight; PutResult#fromProtocol asks Protobuf for the byte buffers that
underlie a ByteString, but if the implementation is LiteralByteString, Protobuf
has no buffers. So it wraps the underlying byte[], and of course the default
endianness is BIG_ENDIAN.
[https://github.com/apache/arrow/blob/c9c5f5f2e8e8f5db4141d06b6e1841f0a55d905a/java/flight/flight-core/src/main/java/org/apache/arrow/flight/PutResult.java#L81]
[https://github.com/protocolbuffers/protobuf/blob/2b7b7f7f72e3617191972fbafb298cf7ec31e95e/java/core/src/main/java/com/google/protobuf/ByteString.java#L1371]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)