felipecrv commented on issue #41604:
URL: https://github.com/apache/arrow/issues/41604#issuecomment-2112670997

   > Then the CompressedInputStream implementation can call preferred_read_size 
on its input to decide its compressed buffer size.
   > 
   > @felipecrv What do you think?
   
   Could work well, but a more flexible alternative to this could be a 
`Readable::Read` version that can mutate the size requested by caller to match 
what was actually read. I've seen this idea in the protobuf stream interfaces 
[1]. Or a min/max constraint to let the implementation decide the best fit [2] 
`size_t read(void* buffer, size_t minBytes, size_t maxBytes);`
   
   [1] 
https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/io/zero_copy_stream.h
   [2] 
https://github.com/capnproto/capnproto/blob/d0c1ad5442831b1e441daa74622f3ea9f92a305c/c%2B%2B/src/kj/io.h#L41-L43


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

Reply via email to