fallintoplace opened a new pull request, #3702: URL: https://github.com/apache/parquet-java/pull/3702
### Rationale for this change `ByteBufferBackedBinary.get2BytesLittleEndian()` currently changes the byte order of its backing `ByteBuffer` to little endian. Because the buffer can be caller-owned, reading the binary can unexpectedly affect subsequent reads through the original buffer. ### What changes are included in this PR? Read the short through a duplicate buffer so the original buffer order remains unchanged. ### Are these changes tested? Yes. The regression test verifies the returned value and preserves the original big-endian order for heap, direct, and read-only buffers. The complete `TestBinary` class and Spotless check pass. ### Are there any user-facing changes? Calling `get2BytesLittleEndian()` no longer changes the order of the caller-owned backing buffer. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
