PG1204 commented on PR #1248: URL: https://github.com/apache/arrow-java/pull/1248#issuecomment-5072480202
### Notes for reviewers - **Empty-buffer path uses `setLong(0, ...)` directly, not the endianness-aware `writeUncompressedLength()`.** This is safe: `reverseBytes(-1) == -1`, so the sentinel reads back correctly on big-endian too. It also matches the existing code, which wrote `0` the same way. - **Test ownership:** with the `-1` sentinel, `decompress()` now routes through the `NO_COMPRESSION_LENGTH` branch -> `extractUncompressedBuffer()`, which returns a slice sharing the compressed buffer's reference manager. The test closes only the decompressed slice (which releases the shared allocation); closing the original `compressed` buffer as well would be a double-free. Verified leak-free via the `RootAllocator` check in `@AfterEach`. -- 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]
