commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: svn commit: r759472 - in /commons/proper/compress/trunk/src/site: site.xml xdoc/examples.xml xdoc/index.xml xdoc/zip.xml
Date Sat, 28 Mar 2009 15:34:15 GMT
On 2009-03-28, sebb <> wrote:

>>>        <p>Reading entries from an ar archive:</p>
>>> <source><![CDATA[
>>> ArArchiveEntry entry = (ArArchiveEntry) arInput.getNextEntry();
>>> byte[] content = new byte[entry.getSize()];
>>> LOOP UNTIL entry.getSize() HAS BEEN READ {

> I thought the idea was that the ArchiveInputStreams would not allow
> one to read past the end of the entry, so one can just read until
> read() returns -1?

I wrote that on the train last night while I was offline and committed
it this afternoon before reading my mail 8-)

I don't think AR is the only archiver that does not return -1 once you
read past the end of the current entry, nor am I convinced that it is
a good idea to expect the streams to do so.

The code of the examples should work and IMHO the API user should
rather rely on the entry's size than on the stream returning -1.  Are
we sure our streams return -1 on directory entries immediately?

BTW, while catching up with mail I saw a lot of discussion going on
inside JIRA instead of on the dev list.  This may be a project
cultural thing, but to me JIRA is not the correct place for that.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message