RFR: 8159: openUncompressedStream supports compressed inputs on all streams
Carter Kozak
duke at openjdk.org
Wed Dec 13 15:43:17 UTC 2023
On Mon, 11 Dec 2023 21:50:16 GMT, Carter Kozak <duke at openjdk.org> wrote:
> Previously this function supported compressed inputs only when the provided stream supported mark/reset. By shifting the BufferedInputStream wrapper prior to compression checks, we can support consistent behavior regardless of the stream implementation.
> The new tests in this commit fail without the accompanying change to `IOToolkit.java`.
>
> I'd be grateful if anyone could help create a jmc issue for this, I lack perms to create a ticket as described in the [contributing docs](https://github.com/openjdk/jmc/blob/master/CONTRIBUTING.md#pull-requests).
core/org.openjdk.jmc.common/src/main/java/org/openjdk/jmc/common/io/IOToolkit.java line 171:
> 169: }
> 170: in.reset();
> 171: return in;
This diff is much easier to follow with whitespace hidden. By moving the `BufferedInputStream` to the beginning of the method we can guarantee mark is supported and remove the conditional.
-------------
PR Review Comment: https://git.openjdk.org/jmc/pull/539#discussion_r1425501609
More information about the jmc-dev
mailing list