You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "ppkarwasz (via GitHub)" <gi...@apache.org> on 2025/10/19 09:18:55 UTC

[PR] Deprecate `IOUtils.readFully` and `IOUtils.skip` [commons-compress]

ppkarwasz opened a new pull request, #736:
URL: https://github.com/apache/commons-compress/pull/736

   This change deprecates `readFully` and `skip` in `o.a.c.compress.utils.IOUtils` in favor of their Commons IO counterparts. Beyond code reuse, this offers two benefits:
   
   * `readFully` had several overloads with inconsistent semantics. All read as many bytes as possible (like `read`), but only one threw on EOF (as `readFully` should).
   * `skip` previously used a per-call byte buffer, unlike the Commons IO version. Since apache/commons-io#801 upstreamed the concurrency fix, this workaround is no longer needed.
   
   **Note**: As `o.a.c.compress.utils.IOUtils` is now rarely used, it is always referenced by FQCN to avoid confusion.
   
   > [!CAUTION]
   > `readFully(InputStream, byte[])` and `readFully(InputStream, byte[], int, int)` exist in both `o.a.c.compress.utils.IOUtils` and `o.a.c.io.IOUtils` with identical signatures, so switching between them will **not show up** in diffs, even though their **behavior differs**.
   >
   > I verified that the Commons IO versions are used in only one `ZipFileTest` call site, and the choice there appears intentional. Nevertheless this is worth double checking.
   


-- 
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: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Deprecate `IOUtils.readFully` and `IOUtils.skip` [commons-compress]

Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz commented on PR #736:
URL: https://github.com/apache/commons-compress/pull/736#issuecomment-3419627840

   Sorry I pasted a comment in the wrong browser tab: I removed the comment from here and added it to https://github.com/apache/commons-compress/pull/737#issuecomment-3419547901


-- 
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: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Deprecate `IOUtils.readFully` and `IOUtils.skip` [commons-compress]

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory merged PR #736:
URL: https://github.com/apache/commons-compress/pull/736


-- 
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: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Deprecate `IOUtils.readFully` and `IOUtils.skip` [commons-compress]

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on PR #736:
URL: https://github.com/apache/commons-compress/pull/736#issuecomment-3419566585

   Hi Piotr,
   
   I'm not sure I see it, can you be more specific?
   
   TY
   Gary
   
   On Sun, Oct 19, 2025 at 6:04 AM Piotr P. Karwasz ***@***.***>
   wrote:
   
   > *ppkarwasz* left a comment (apache/commons-compress#736)
   > <https://github.com/apache/commons-compress/pull/736#issuecomment-3419544464>
   >
   > @garydgregory <https://github.com/garydgregory>,
   >
   > I think there should be an IOUtils method also for this pattern (e.g.
   > IOUtils.toByteArray(IOConsumer<OutputStream>)):
   >
   >
   > https://github.com/apache/commons-compress/blob/aa09b869b5e57cac1aa8c8f3eff4c1b61e948b0e/src/main/java/org/apache/commons/compress/harmony/pack200/PackingUtils.java#L167-L172
   >
   > What do you think?
   >
   > —
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/commons-compress/pull/736#issuecomment-3419544464>,
   > or unsubscribe
   > <https://github.com/notifications/unsubscribe-auth/AAJB6N22PDFEC3H4OHSZG633YNO37AVCNFSM6AAAAACJTCQZXOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTIMJZGU2DINBWGQ>
   > .
   > You are receiving this because you were mentioned.Message ID:
   > ***@***.***>
   >
   


-- 
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: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Deprecate `IOUtils.readFully` and `IOUtils.skip` [commons-compress]

Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on PR #736:
URL: https://github.com/apache/commons-compress/pull/736#issuecomment-3419654026

   Hi @ppkarwasz 
   Would you please resolve the conflicts? (created I think by merged some other PRs).
   


-- 
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: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Deprecate `IOUtils.readFully` and `IOUtils.skip` [commons-compress]

Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz commented on PR #736:
URL: https://github.com/apache/commons-compress/pull/736#issuecomment-3419544464

   @garydgregory,
   
   I think there should be an `IOUtils` method also for this pattern (e.g. `IOUtils.toByteArray(IOConsumer<OutputStream>)`):
   
   https://github.com/apache/commons-compress/blob/aa09b869b5e57cac1aa8c8f3eff4c1b61e948b0e/src/main/java/org/apache/commons/compress/harmony/pack200/PackingUtils.java#L167-L172
   
   What do you think?


-- 
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: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org