harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jesse Wilson <jessewil...@google.com>
Subject Re: [classlib][archive] JarFile#getInputStream() (was: Re: [testing] M12 testing on Windows x86)
Date Mon, 30 Nov 2009 16:54:16 GMT
On Mon, Nov 30, 2009 at 2:08 AM, Tim Ellison <t.p.ellison@gmail.com> wrote:

> The method JarFile#getInputStream(ZipEntry) is spec'd to return an
> InputStream, not a ZipInputStream.
>
> Furthermore, as I showed, the RI returns a stream that answers with
> available() > 1, i.e. it follows the InputStream spec.
>

Yup. And if we want to do likewise, we should change he *runtime* type of
the returned stream so that it isn't a subtype of ZipInputStream.



> We should follow the spec and RI behavior.  While we have only got
> examples of our own code making the assumption on available() [1] I
> expect that there will be third-party applications making the same
> assumptions.
>

You're right. Sadly this bogus pattern is quite common.
  http://www.google.com/codesearch?hl=en&start=10&sa=N&q=new
\+byte\[\w%2B\.available\(\)\]+file:\.java

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message