RFR: 8282648: Problems due to conflicting specification of Inflater::inflate(..) and InflaterInputStream::read(..) [v2]

Volker Simonis simonis at openjdk.java.net
Tue Mar 29 12:48:49 UTC 2022


On Tue, 29 Mar 2022 01:58:05 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

> Hello Volker, An additional thing that we might have to consider here is whether adding this javadoc change to `InflaterInputStream` is ever going to "show up" to end user applications. What I mean is, I think in many cases the end user applications won't even know they are dealing with an `InflaterInputStream`. For example, the following code:
> 
> ```
> ZipFile zf = ...
> ZipEntry ze = zf.getEntry("some-file");
> InputStream is = zf.getInputStream(ze);
> ```
> 
> As we see above, none of these APIs talk about `InflaterInputStream` (the return type of `ZipFile.getInpustream(...)` is an `InputStream`). So end users won't be able to view this spec change. Perhaps we should also add some note in the `ZipFile.getInpustream(....)` API to make a mention of this potential difference in behaviour of the returned stream?

You are right with your observation and I'll be happy to add a corresponding comment if @LanceAndersen and @AlanBateman agree. Please let me know what you think?

-------------

PR: https://git.openjdk.java.net/jdk/pull/7986


More information about the core-libs-dev mailing list