sachinnn99 opened a new pull request, #16167:
URL: https://github.com/apache/iceberg/pull/16167

   Fixes #16127.
   
   `SingleBufferInputStream.read()` and `MultiBufferInputStream.read()` throw 
`EOFException` when the stream is exhausted. This violates the 
`java.io.InputStream` contract, which requires the no-arg `read()` to return 
`-1` at EOF.
   
   The multi-byte `read(byte[], int, int)` in both classes already correctly 
returns `-1` at EOF — the two overloads were inconsistent.
   
   **Changes:**
   - `SingleBufferInputStream.read()`: return `-1` instead of throwing 
`EOFException`
   - `MultiBufferInputStream.read()`: return `-1` at both EOF entry points 
instead of throwing `EOFException`
   - Update `testReadByte()` to assert `-1` return (including idempotency check)
   
   Other `EOFException`-throwing methods (`slice()`, `sliceBuffers()`, 
`skipFully()`) are unchanged — they request specific byte counts where 
`EOFException` is the correct signal.


-- 
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]

Reply via email to