hutiefang76 opened a new pull request, #3870:
URL: https://github.com/apache/parquet-java/pull/3870

   ### Rationale for this change
   
   A `ByteBufferInputStream` selected from one source buffer flips the caller's 
destination, while the same public API with multiple source buffers advances 
its position and preserves its limit. This breaks prefilled destinations and 
subsequent append reads depending on the source layout.
   
   ### What changes are included in this PR?
   
   Align the single-buffer read with the existing multi-buffer behavior: 
advance the destination by the copied count, preserve its limit, and leave it 
unchanged when there is no destination space or the stream is exhausted. 
Document the contract on the public method.
   
   ### Are these changes tested?
   
   The baseline has 12 single-buffer failures and 12 passing multi-buffer 
controls through both public `wrap` overloads. All 24 cases pass after the fix, 
covering partial/full copies, successive appends, heap/direct/sliced 
destinations, zero space and EOF.
   
   Root `./mvnw -B clean verify` passed on Microsoft OpenJDK 17.0.18 with 
Thrift 0.25.0: 2,914 tests, 0 failures/errors, 31 existing disabled or 
conditional skips (including optional Hadoop bridges and Windows-only checks). 
Spotless, Apache RAT and API compatibility checks stayed enabled.
   
   ### Are there any user-facing changes?
   
   Single-buffer reads now leave the destination ready for further writes, 
matching multi-buffer streams. Callers can flip it once after filling it. EOF 
returns -1 when the destination has room; a destination with no remaining space 
returns 0. Public signatures are unchanged.
   
   Closes #3869.
   


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